예제 #1
0
        public void GenericClassWithGenericMethodWitoutTarget()
        {
            var interceptor            = new SetReturnValueInterceptor(3);
            IDoubleGeneric <int> proxy =
                (IDoubleGeneric <int>)generator.CreateInterfaceProxyWithoutTarget(typeof(IDoubleGeneric <int>),
                                                                                  interceptor);
            object o = proxy.Call(1, "");

            Assert.AreEqual(3, o);
        }
예제 #2
0
        public void GenericClassWithGenericMethod()
        {
            LogInvocationInterceptor logger = new LogInvocationInterceptor();
            IDoubleGeneric <int>     proxy  =
                (IDoubleGeneric <int>)generator.CreateInterfaceProxyWithTarget(typeof(IDoubleGeneric <int>),
                                                                               new DoubleGenericImpl <int>(), logger);

            proxy.Call <string>(1, "");
            Assert.AreEqual("Call", logger.Invocations[0]);
        }