예제 #1
0
        public void MustIgnoreCase()
        {
            sut.Initialize(new FilterRuleSettings {
                Expression = Regex.Escape("http://www.test.org/path/file.txt?param=123")
            });

            Assert.IsTrue(sut.IsMatch(new Request {
                Url = "hTtP://wWw.TeSt.OrG/pAtH/fIlE.tXt?PaRaM=123"
            }));
            Assert.IsTrue(sut.IsMatch(new Request {
                Url = "HtTp://WwW.tEst.oRg/PaTh/FiLe.TxT?pArAm=123"
            }));

            sut.Initialize(new FilterRuleSettings {
                Expression = Regex.Escape("HTTP://WWW.TEST.ORG/PATH/FILE.TXT?PARAM=123")
            });

            Assert.IsTrue(sut.IsMatch(new Request {
                Url = "hTtP://wWw.TeSt.OrG/pAtH/fIlE.tXt?PaRaM=123"
            }));
            Assert.IsTrue(sut.IsMatch(new Request {
                Url = "HtTp://WwW.tEst.oRg/PaTh/FiLe.TxT?pArAm=123"
            }));
        }