public void MethodInfoClosedInNongenIfcGenMethodNoTarget()
        {
            var interceptor = new KeepDataInterceptor();
            var proxy       = generator.CreateInterfaceProxyWithoutTarget <OnlyGenMethodsInterface>(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>));
        }
        public void MethodInfoClosedInGenIfcNongenMethodValueTypeNoTarget()
        {
            var interceptor = new KeepDataInterceptor();
            var proxy       =
                generator.CreateInterfaceProxyWithoutTarget <IGenInterfaceHierarchyBase <int> >(interceptor);

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

            proxy.Add(0);
            GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(void), typeof(int));
        }
        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>));
        }
        public void MethodInfoClosedInGenTypeNongenMethodRefTypeRefType()
        {
            KeepDataInterceptor interceptor = new KeepDataInterceptor();
            GenClassWithGenReturn <List <object>, List <object> > proxy =
                generator.CreateClassProxy <GenClassWithGenReturn <List <object>, List <object> > >(interceptor);

            proxy.DoSomethingT();
            GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(List <object>));

            proxy.DoSomethingZ();
            GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(List <object>));
        }
        public void MethodInfoClosedInGenIfcGenMethodRefTypeNoTarget()
        {
            var interceptor = new KeepDataInterceptor();
            var proxy       = generator.CreateInterfaceProxyWithoutTarget <GenInterfaceWithGenMethods <List <object> > >(interceptor);

            proxy.DoSomething(1, null);
            GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(void), typeof(int),
                                                       typeof(List <object>));
            Assert.AreEqual(null, interceptor.Invocation.GetConcreteMethodInvocationTarget());

            proxy.DoSomething(new List <object>(), new List <object>());
            GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(void),
                                                       typeof(List <object>), typeof(List <object>));
            Assert.AreEqual(null, interceptor.Invocation.GetConcreteMethodInvocationTarget());
        }
        public void MethodInfoClosedInGenTypeNongenMethodValueTypeValueType()
        {
            KeepDataInterceptor interceptor        = new KeepDataInterceptor();
            GenClassWithGenReturn <int, int> proxy = generator.CreateClassProxy <GenClassWithGenReturn <int, int> >(interceptor);

            proxy.DoSomethingT();
            GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(int));
            Assert.AreEqual(interceptor.Invocation.GetConcreteMethod(),
                            interceptor.Invocation.GetConcreteMethodInvocationTarget().GetBaseDefinition());

            proxy.DoSomethingZ();
            GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(int));
            Assert.AreEqual(interceptor.Invocation.GetConcreteMethod(),
                            interceptor.Invocation.GetConcreteMethodInvocationTarget().GetBaseDefinition());
        }
        public void MethodInfoClosedInGenIfcNongenMethodValueTypeWithTarget()
        {
            var interceptor = new KeepDataInterceptor();
            IGenInterfaceHierarchyBase <int> target = new GenInterfaceHierarchy <int>();
            var proxy =
                generator.CreateInterfaceProxyWithTarget(target, interceptor);

            proxy.Add(0);
            GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(void), typeof(int));
            GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethodInvocationTarget(), typeof(void),
                                                       typeof(int));
            Assert.AreNotEqual(interceptor.Invocation.GetConcreteMethod(),
                               interceptor.Invocation.GetConcreteMethodInvocationTarget());

            proxy.Get();
            GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(int));
            GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethodInvocationTarget(), typeof(int));
            Assert.AreNotEqual(interceptor.Invocation.GetConcreteMethod(),
                               interceptor.Invocation.GetConcreteMethodInvocationTarget());
        }
        public void MethodInfoClosedInNongenIfcGenMethodWithTarget()
        {
            var interceptor = new KeepDataInterceptor();
            OnlyGenMethodsInterface target = new OnlyGenMethodsInterfaceImpl();
            var proxy =
                generator.CreateInterfaceProxyWithTarget(target, interceptor);

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

            proxy.DoSomething(new List <object>());
            GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(List <object>),
                                                       typeof(List <object>));
            GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethodInvocationTarget(),
                                                       typeof(List <object>), typeof(List <object>));
            Assert.AreNotEqual(interceptor.Invocation.GetConcreteMethod(),
                               interceptor.Invocation.GetConcreteMethodInvocationTarget());
        }