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

ParseSimpleForIn() private method

private ParseSimpleForIn ( ) : void
return void
        public void ParseSimpleForIn()
        {
            ICommand command = ParseCommand("for (var k in b) a=a+k;");

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

            IList<ICommand> cmds = ((CompositeCommand)command).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