internal void Parse() { Rules = new MessageRules(); Messages = new List <string>(); foreach (var line in Readlines()) { ParseLine(line); } }
public void Test_Rules(string message, bool expectedMatch) { var rules = new MessageRules(); rules.AddFollowingRule(0, new[] { 4, 1, 5 }); rules.AddFollowingOrRule(1, new[] { 2, 3 }, new[] { 3, 2 }); rules.AddFollowingOrRule(2, new[] { 4, 4 }, new[] { 5, 5 }); rules.AddFollowingOrRule(3, new[] { 4, 5 }, new[] { 5, 4 }); rules.AddConstantRule(4, 'a'); rules.AddConstantRule(5, 'b'); var result = rules.IsValid(message); Assert.AreEqual(expectedMatch, result); }
public FollowingRule(MessageRules rulesCollection) : base(rulesCollection) { }
public CharacterRule(MessageRules rulesCollection) : base(rulesCollection) { }
public MessageRule(MessageRules rulesCollection) { RulesCollection = rulesCollection; }