AjScript.Tests.Interpreter.ParserTests.ParseSimpleForInWithLocalVar C# (CSharp) Method

ParseSimpleForInWithLocalVar() private method

private ParseSimpleForInWithLocalVar ( ) : void
return void
        public void ParseSimpleForInWithLocalVar()
        {
            ICommand command = ParseCommand("for (var x in b) c=c+x;");

            Assert.IsNotNull(command);
            Assert.IsInstanceOfType(command, typeof(CompositeCommand));

            CompositeCommand ccmd = (CompositeCommand)command;

            Assert.AreEqual(2, ccmd.CommandCount);
            IList<ICommand> cmds = ccmd.Commands.ToList();

            Assert.IsInstanceOfType(cmds[0], typeof(VarCommand));
            Assert.IsInstanceOfType(cmds[1], typeof(ForEachCommand));

            ForEachCommand foreachcmd = (ForEachCommand)cmds[1];

            Assert.IsNotNull(foreachcmd.Expression);
            Assert.IsInstanceOfType(foreachcmd.Expression, typeof(VariableExpression));
            Assert.IsNotNull(foreachcmd.Command);
            Assert.IsInstanceOfType(foreachcmd.Command, typeof(SetCommand));
        }
ParserTests