public void TestOutMethod() { string tResult = String.Empty; var tPoco = new MethOutPoco(); var tName = "Func"; var tContext = GetType(); var tBinder = Binder.InvokeMember(CSharpBinderFlags.None, tName, null, tContext, new[] { CSharpArgumentInfo.Create( CSharpArgumentInfoFlags.None, null), CSharpArgumentInfo.Create( CSharpArgumentInfoFlags.IsOut | CSharpArgumentInfoFlags.UseCompileTimeType, null) }); var tSite = Dynamic.CreateCallSite <DynamicTryString>(tBinder, tName, tContext); tSite.Target.Invoke(tSite, tPoco, out tResult); Assert.AreEqual("success", tResult); }
public void OutMethodTest() { var tPoco = new MethOutPoco(); var tActsLike = tPoco.ActLike <IMethodOut>(); string tResult = String.Empty; var tOut = tActsLike.Func(out tResult); Assert.AreEqual(true, tOut); Assert.AreEqual("success", tResult); }
public void TestOutMethod() { string tResult = String.Empty; var tPoco = new MethOutPoco(); var tName = "Func"; var tContext = GetType(); var tBinder = Binder.InvokeMember(BinderFlags.None, tName, null, tContext, new[] { Info.Create( InfoFlags.None, null), Info.Create( InfoFlags.IsOut | InfoFlags.UseCompileTimeType, null) }); var tSite = Impromptu.CreateCallSite<DynamicTryString>(tBinder, tName, tContext); tSite.Target.Invoke(tSite, tPoco, out tResult); Assert.AreEqual("success", tResult); }
public void OutMethodTest() { var tPoco = new MethOutPoco(); var tActsLike = tPoco.ActLike<IMethodOut>(); string tResult = String.Empty; var tOut = tActsLike.Func(out tResult); Assert.AreEqual(true, tOut); Assert.AreEqual("success", tResult); }