// Helper to test smarty route match, null match string is used for no expected match
        private void ConstraintTest(IEnumerable<string> validFiles, IEnumerable<string> supportedExt, string url, string match, string pathInfo) {
            HashyVPP vpp = new HashyVPP(validFiles);
            var virtualPathFactoryManager = new VirtualPathFactoryManager(vpp);

            WebPageMatch smartyMatch = WebPageRoute.MatchRequest(url, supportedExt, virtualPathFactoryManager);
            if (match != null) {
                Assert.IsNotNull(smartyMatch, "Should have found a match: "+match);
                Assert.AreEqual(match, smartyMatch.MatchedPath);
                Assert.AreEqual(pathInfo, smartyMatch.PathInfo);
            }
            else {
                Assert.IsNull(smartyMatch, "unexpected match");
            }

        }
Beispiel #2
0
        // Helper to test smarty route match, null match string is used for no expected match
        private void ConstraintTest(IEnumerable <string> validFiles, IEnumerable <string> supportedExt, string url, string match, string pathInfo)
        {
            HashyVPP vpp = new HashyVPP(validFiles);
            var      virtualPathFactoryManager = new VirtualPathFactoryManager(vpp);

            WebPageMatch smartyMatch = WebPageRoute.MatchRequest(url, supportedExt, virtualPathFactoryManager);

            if (match != null)
            {
                Assert.IsNotNull(smartyMatch, "Should have found a match: " + match);
                Assert.AreEqual(match, smartyMatch.MatchedPath);
                Assert.AreEqual(pathInfo, smartyMatch.PathInfo);
            }
            else
            {
                Assert.IsNull(smartyMatch, "unexpected match");
            }
        }