AjScript.Tests.Interpreter.ParserTests.ParseSimpleUnaryExpression C# (CSharp) Méthode

ParseSimpleUnaryExpression() private méthode

private ParseSimpleUnaryExpression ( ) : void
Résultat void
        public void ParseSimpleUnaryExpression()
        {
            IExpression expression = this.ParseExpression("-2");

            Assert.IsNotNull(expression);
            Assert.IsInstanceOfType(expression, typeof(ArithmeticUnaryExpression));

            ArithmeticUnaryExpression operation = (ArithmeticUnaryExpression)expression;

            Assert.AreEqual(ArithmeticOperator.Minus, operation.Operation);
            Assert.IsNotNull(operation.Expression);
            Assert.IsInstanceOfType(operation.Expression, typeof(ConstantExpression));
        }
ParserTests