Exemplo n.º 1
0
        public void EvaluateInvokeFunctionWithSimpleObjectAndProperty()
        {
            SubrInvoke invoke = new SubrInvoke();

            object result = invoke.Apply(new List("foo", new List("Length")), null);

            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(result, typeof(int));
            Assert.AreEqual(3, result);
        }
Exemplo n.º 2
0
        public void EvaluateInvokeFunctionWithSimpleObjectAndMethod()
        {
            SubrInvoke invoke = new SubrInvoke();

            object result = invoke.Apply(new List(123, new List("ToString")), null);

            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(result, typeof(string));
            Assert.AreEqual("123", result);
        }
Exemplo n.º 3
0
        public void EvaluateInvokeFunctionWithObjectMethodAndArguments()
        {
            SubrInvoke invoke = new SubrInvoke();

            System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(".");

            object result = invoke.Apply(new List(di, new List("GetFiles", new List("*.exe"))), null);

            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(result, typeof(System.IO.FileInfo[]));
        }