Example #1
0
        public void Matches_Parameter_FindsMatch()
        {
            var parser = new PathParser("/foo/:param", false);

            Assert.True(parser.Matches("/foo/bar"));
            Assert.True(parser.Matches("/foo/baz"));
            Assert.True(parser.Matches("/foo/quux"));
            Assert.True(parser.Matches("/foo/corge"));
        }
Example #2
0
        public void Matches_IgnoneTrailingSlash_FindsMatch()
        {
            var parser = new PathParser("/foo/", true);

            Assert.True(parser.Matches("/foo"));

            parser = new PathParser("/foo", true);
            Assert.True(parser.Matches("/foo/"));
        }
Example #3
0
        public void Matches_Wildcard_FindsMatch()
        {
            var parser = new PathParser("/*", false);

            Assert.True(parser.Matches("/foo"));
            Assert.True(parser.Matches("/bar"));
            Assert.True(parser.Matches("/baz"));
            Assert.True(parser.Matches("/foo/bar"));
            Assert.True(parser.Matches("/foo/baz"));
            Assert.True(parser.Matches("/foo/bar/baz"));
        }
Example #4
0
        public void Matches_Wildcard_NoMatch()
        {
            var parser = new PathParser("/foo/*", false);

            Assert.False(parser.Matches("/foo"));
        }
Example #5
0
        public void Matches_Parameter_NoMatch()
        {
            var parser = new PathParser("/foo/:param", false);

            Assert.False(parser.Matches("/foo/bar/baz"));
        }
Example #6
0
        public void Matches_Normal_FindsMatch()
        {
            var parser = new PathParser("/foo", true);

            Assert.True(parser.Matches("/foo"));
        }
Example #7
0
        public void Matches_EnforceTrailingSlash_NoMatch()
        {
            var parser = new PathParser("/foo/", false);

            Assert.False(parser.Matches("/foo"));
        }
Example #8
0
        public void Matches_Normal_NoMatch()
        {
            var parser = new PathParser("/foo", true);

            Assert.False(parser.Matches("/bar"));
        }
Example #9
0
 internal bool Matches(string requestUri)
 {
     return(PathParser.Matches(requestUri));
 }