Example #1
0
        public void IsMatchWithCaseInsensitiveReturnsFalseForNearMatch()
        {
            // Arrange.
            const string Path    = "/WebApp/Administration/Test.aspx?Param1=42&Param2=No";
            const string Pattern = "/webapp/administration/test.aspx?param1=42&param2=yes";

            var matcher = new ExactPathMatcher();

            // Act.
            var result = matcher.IsMatch(Path, Pattern, true);

            // Assert.
            Assert.False(result);
        }
Example #2
0
        public void IsMatchReturnsFalseForMissingQuery()
        {
            // Arrange.
            const string Path    = "/WebApp/Administration/Test.aspx?Param1=42&Param2=No";
            const string Pattern = "/WebApp/Administration/Test.aspx";

            var matcher = new ExactPathMatcher();

            // Act.
            var result = matcher.IsMatch(Path, Pattern, true);

            // Assert.
            Assert.False(result);
        }
Example #3
0
        public void IsMatchWithCaseSensitiveReturnsTrueForExactMatch()
        {
            // Arrange.
            const string Path    = "/WebApp/Administration/Test.aspx?Param1=42&Param2=No";
            const string Pattern = "/WebApp/Administration/Test.aspx?Param1=42&Param2=No";

            var matcher = new ExactPathMatcher();

            // Act.
            var result = matcher.IsMatch(Path, Pattern, false);

            // Assert.
            Assert.True(result);
        }