コード例 #1
0
        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)));
        }
コード例 #2
0
        public void IncDecIntTest()
        {
            Increment inc = new Increment();
            Decrement dec = new Decrement();

            Assert.AreEqual(_zeroInt, dec.Execute(inc.Execute(_zeroInt)));
        }
コード例 #3
0
ファイル: Block.cs プロジェクト: waptdragon3/JASL
 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();
     }
 }