Example #1
0
        public void IsOver_AtMiddle_IsFalse()
        {
            var        i        = new WriteableExpressionVariable(0);
            Expression variable = i.expression;
            Expression from     = Expression.Constant(0);
            Expression to       = Expression.Constant(2);

            var forLoop = new ForLoop(variable, from, to);

            forLoop.TakeStep();
            forLoop.TakeStep();

            Assert.IsFalse(forLoop.IsOver);
        }
Example #2
0
        public void TakeStep_WhenCalled_ChangesVariableValue()
        {
            var        i        = new WriteableExpressionVariable(0);
            Expression variable = i.expression;
            Expression from     = Expression.Constant(0);
            Expression to       = Expression.Constant(2);

            var forLoop     = new ForLoop(variable, from, to);
            var notExpected = i.value;

            forLoop.TakeStep();
            var actual = i.value;

            Assert.AreNotEqual(notExpected, actual);
        }