示例#1
0
        public void MethodInfoClosedInNongenTypeGenMethod()
        {
            KeepDataInterceptor interceptor = new KeepDataInterceptor();
            OnlyGenMethodsClass proxy       = generator.CreateClassProxy <OnlyGenMethodsClass>(interceptor);

            proxy.DoSomething(1);
            GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(int), typeof(int));

            proxy.DoSomething(new List <object>());
            GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(List <object>),
                                                       typeof(List <object>));
        }
示例#2
0
        public void ClassWithGenMethodOnly()
        {
            OnlyGenMethodsClass proxy = generator.CreateClassProxy <OnlyGenMethodsClass>(logger);

            Assert.IsNotNull(proxy);

            proxy.DoSomething(new List <object>());

            Assert.IsTrue(proxy.Invoked);
            Assert.AreEqual("DoSomething ", logger.LogContents);
        }