public void TestEndRule() { var rule = new StringRule("test") + new EndRule(); Assert.IsTrue(rule.Match("test")); Assert.IsFalse(rule.Match("tes")); }
public void TestOrUsingOperatorRule() { var rule = new StringRule("cat") | new StringRule("dog"); Assert.IsFalse(rule.Match("something")); Assert.IsFalse(rule.Match("fishcatdog")); Assert.IsTrue(rule.Match("catfish")); Assert.IsTrue(rule.Match("dogfish")); }
public void TestStringCaseInsensitiveRule() { var rule = new StringRule("Test", true); Assert.IsTrue(rule.Match("Test")); Assert.IsTrue(rule.Match("Test123")); Assert.IsTrue(rule.Match("test123")); Assert.IsFalse(rule.Match("Failing Test")); }
public void TestStringRule() { var rule = new StringRule("Test"); Assert.IsTrue(rule.Match("Test")); Assert.IsTrue(rule.Match("Test123")); Assert.IsFalse(rule.Match("test123")); Assert.IsFalse(rule.Match("Failing Test")); }
public void TestSequenceUsingOperatorRule() { var rule = new StringRule("cat") + new StringRule("fish"); Assert.IsFalse(rule.Match("catsomething")); Assert.IsFalse(rule.Match("fishcat")); Assert.IsTrue(rule.Match("catfish")); Assert.IsTrue(rule.Match("catfish something")); }