Пример #1
0
        private void GenericMethHelper2 <T>(T param)
        {
            dynamic tNew = new ExpandoObject();

            tNew.Action2 = new Func <T, T>(it => it);
            IGenericMeth tActsLike = Impromptu.ActLike <IGenericMeth>(tNew);

            Assert.AreEqual(param, tActsLike.Action2(param));
        }
Пример #2
0
        private void GenericMethHelper <T>(T param, string expected)
        {
            dynamic tNew = new ExpandoObject();

            tNew.Action = new Func <T, string>(it => it.ToString());
            IGenericMeth tActsLike = Impromptu.ActLike <IGenericMeth>(tNew);

            Assert.AreEqual(expected, tActsLike.Action(param));
        }