public void Execute(Context context) { if (context.IncrementRuleCount() > 500) { throw new ApplicationException(String.Format("Rule count exceeded 500 when running rule {0}", this.Name)); } Commands.Execute(context); }
public void Execute(Context context) { if (context.IncrementRuleCount() > 500) { throw new ApplicationException(String.Format("Rule count exceeded 500 when running rule {0}", this.Name)); } Commands.Execute(context); }
public void TestRuleCount() { Context c = new Context(); Assert.AreEqual(0, c.RuleCount); Assert.AreEqual(1, c.IncrementRuleCount()); Assert.AreEqual(1, c.RuleCount); Assert.AreEqual(2, c.IncrementRuleCount()); c.ResetRuleCount(); Assert.AreEqual(0, c.RuleCount); }