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); }
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); }
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[])); }