Evaluate() public méthode

public Evaluate ( IContext context ) : object
context IContext
Résultat object
        public void EvaluateUndefined()
        {
            TypeOfExpression expr = new TypeOfExpression(new VariableExpression("foo"));
            var result = expr.Evaluate(new Context());

            Assert.IsNotNull(result);
            Assert.AreEqual("undefined", result);
        }
        public void EvaluateReal()
        {
            TypeOfExpression expr = new TypeOfExpression(new ConstantExpression(Math.PI));
            var result = expr.Evaluate(null);

            Assert.IsNotNull(result);
            Assert.AreEqual("number", result);
        }
        public void EvaluateString()
        {
            TypeOfExpression expr = new TypeOfExpression(new ConstantExpression("foo"));
            var result = expr.Evaluate(null);

            Assert.IsNotNull(result);
            Assert.AreEqual("string", result);
        }
        public void EvaluateArray()
        {
            TypeOfExpression expr = new TypeOfExpression(new VariableExpression("foo"));
            Context ctx = new Context();
            ctx.SetValue("foo", (new ArrayFunction(ctx)).NewInstance(new object[] { }));
            var result = expr.Evaluate(ctx);

            Assert.IsNotNull(result);
            Assert.AreEqual("object", result);
        }