Example #1
0
        public void TestUrlStringMatchCondition2()
        {
            var cond = new UrlStringMatchCondition(@"((http)|(https)://)?www.gridsum.com/.*\.txt$", MatchType.RegexMatch, false);

            Assert.IsFalse(cond.Matches("www.gridsum.com/1.txt?a=b"));
            Assert.IsFalse(cond.Matches("http://www.gridsum.com/2.txt#section2"));
            Assert.IsTrue(cond.Matches("https://www.gridsum.com/3.txt"));
            Assert.IsFalse(cond.Matches("https://www.gridsum.com/3.txta"));
        }
Example #2
0
 public StringMatchable(string pattern, MatchType matchType)
 {
     this.m_pattern = pattern;
     m_cond         = new UrlStringMatchCondition(pattern, matchType, false);
 }