public void IncrementIntTest() { Increment op = new Increment(); Integer supposedTwoInt = op.Execute(_oneInt); Assert.AreEqual(_twoInt, supposedTwoInt); Integer supposedZeroInt = op.Execute(_minusOneInt); Assert.AreEqual(_zeroInt, supposedZeroInt); Assert.AreEqual(_twoInt, op.Execute(op.Execute(_zeroInt))); }
public void IncDecIntTest() { Increment inc = new Increment(); Decrement dec = new Decrement(); Assert.AreEqual(_zeroInt, dec.Execute(inc.Execute(_zeroInt))); }
public override void Execute() { if (Test.ReturnType != JType.GetType("bool")) { throw new Exception("Invalid Test expression return type"); } Initialize.Execute(); while (Test.Evaluate().Equals(JBool.True)) { foreach (var statement in Statements) { statement.Execute(); } Increment.Execute(); } }