AjScript.Commands.Tests.CommandsTests.ExecuteForEachCommand C# (CSharp) Метод

ExecuteForEachCommand() приватный Метод

private ExecuteForEachCommand ( ) : void
Результат void
        public void ExecuteForEachCommand()
        {
            IExpression addToX = new ArithmeticBinaryExpression(ArithmeticOperator.Add, new VariableExpression("b"), new VariableExpression("a"));
            ICommand setX = new SetVariableCommand("a", addToX);
            IExpression values = new ConstantExpression(new int[] { 1, 2, 3 });

            ForEachCommand foreachcmd = new ForEachCommand("b", values, setX);

            Context context = new Context();

            context.SetValue("a", 0);

            foreachcmd.Execute(context);

            Assert.AreEqual(6, context.GetValue("a"));
        }