예제 #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"));
        }
예제 #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/"));
        }
예제 #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"));
        }
예제 #4
0
        public void Matches_Wildcard_NoMatch()
        {
            var parser = new PathParser("/foo/*", false);

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

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

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

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

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