コード例 #1
0
        public void CreateUnaryExpression()
        {
            IExpression valueExpression = new ConstantExpression(1);
            UnaryExpression expression = new ArithmeticUnaryExpression(ArithmeticOperator.Minus, valueExpression);

            Assert.IsTrue(expression.Expression == valueExpression);
        }
コード例 #2
0
        private static object EvaluateArithmeticUnaryOperator(ArithmeticOperator operation, object value)
        {
            IExpression expression = new ArithmeticUnaryExpression(operation, new ConstantExpression(value));

            return expression.Evaluate(null);
        }