Exemplo n.º 1
0
        public void NewInstance()
        {
            ArrayFunction function = new ArrayFunction(null);
            object instance = function.NewInstance(null);

            Assert.IsNotNull(instance);
            Assert.IsInstanceOfType(instance, typeof(ArrayObject));
        }
Exemplo n.º 2
0
        public void EvaluateEmptyArray()
        {
            Context context = new Context();
            var objfn = new ObjectFunction(context);
            var arrfn = new ArrayFunction(context);
            context.SetValue("Object", objfn);
            context.SetValue("Array", arrfn);

            InstanceOfExpression expr = new InstanceOfExpression(new ConstantExpression(objfn.NewInstance(null)), new VariableExpression("Object"));
            var result = expr.Evaluate(context);

            Assert.IsNotNull(result);
            Assert.AreEqual(true, result);
        }