public void EvaluateDelayedCallExpression() { Context context = new Context(); Function function = new Function(context, new object[] { new Variable("X"), new Variable("Y") }, new AddExpression(new VariableExpression(new Variable("X")), new VariableExpression(new Variable("Y")))); context.SetValue("add/2", function); DelayedCallExpression expr = new DelayedCallExpression(new AtomExpression(new Atom("add")), new IExpression[] { new ConstantExpression(1), new ConstantExpression(2) }); Assert.IsFalse(expr.HasVariable()); Assert.IsNotNull(expr.NameExpression); Assert.IsInstanceOfType(expr.NameExpression, typeof(AtomExpression)); Assert.IsNotNull(expr.ArgumentExpressions); Assert.AreEqual(2, expr.ArgumentExpressions.Count); var result = expr.Evaluate(context); Assert.IsNotNull(result); Assert.IsInstanceOfType(result, typeof(DelayedCall)); Assert.AreEqual(3, ((DelayedCall)result).Evaluate()); }