示例#1
0
        public void TestStringCondition1()
        {
            var cond = new StringMatchCondition("abc");

            Assert.IsTrue(cond.Matches("abc"));
            Assert.IsFalse(cond.Matches("abc1"));
        }
示例#2
0
        public void TestStringCondition2()
        {
            var cond = new StringMatchCondition("abc", MatchType.BeginsWith);

            Assert.IsTrue(cond.Matches("abc"));
            Assert.IsTrue(cond.Matches("abc1"));
            Assert.IsFalse(cond.Matches("1abc"));
        }
示例#3
0
        public void TestStringCondition3()
        {
            var cond = new StringMatchCondition("abc", MatchType.Contains);

            Assert.IsTrue(cond.Matches("abc"));
            Assert.IsTrue(cond.Matches("abc1"));
            Assert.IsTrue(cond.Matches("1abc"));
            Assert.IsFalse(cond.Matches("abd"));
        }
示例#4
0
        public void TestStringCondition4()
        {
            var cond = new StringMatchCondition(".*ab[cd].*", MatchType.RegexMatch);

            Assert.IsTrue(cond.Matches("abc"));
            Assert.IsTrue(cond.Matches("abc1"));
            Assert.IsTrue(cond.Matches("1abc"));
            Assert.IsTrue(cond.Matches("abd"));
            Assert.IsFalse(cond.Matches("abef"));
        }