예제 #1
0
파일: Invoke.cs 프로젝트: ijsgaus/dynamitey
        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);
        }
예제 #2
0
        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);

        }
예제 #4
0
        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);
        }