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

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

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

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

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

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