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

ParseSetVariableCommand() private method

private ParseSetVariableCommand ( ) : void
return void
        public void ParseSetVariableCommand()
        {
            ICommand command = ParseCommand("a = 1;");

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

            SetCommand setcmd = (SetCommand)command;

            Assert.IsInstanceOfType(setcmd.LeftValue, typeof(VariableExpression));
            Assert.AreEqual("a", ((VariableExpression)setcmd.LeftValue).Name);
            Assert.IsNotNull(setcmd.Expression);
            Assert.IsInstanceOfType(setcmd.Expression, typeof(ConstantExpression));
            Assert.AreEqual(1, setcmd.Expression.Evaluate(null));
        }
ParserTests