IncrementRuleCount() публичный Метод

public IncrementRuleCount ( ) : int
Результат int
Пример #1
0
		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);
	    }
Пример #2
0
        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);

               
        }
Пример #3
0
        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);
        }