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 MethodInfoClosedInGenIfcNongenMethodRefTypeWithTarget() { KeepDataInterceptor interceptor = new KeepDataInterceptor(); IGenInterfaceHierarchyBase <List <object> > target = new GenInterfaceHierarchy <List <object> >(); IGenInterfaceHierarchyBase <List <object> > proxy = generator.CreateInterfaceProxyWithTarget <IGenInterfaceHierarchyBase <List <object> > >(target, interceptor); proxy.Add(null); GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(void), typeof(List <object>)); GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethodInvocationTarget(), typeof(void), typeof(List <object>)); Assert.AreNotEqual(interceptor.Invocation.GetConcreteMethod(), interceptor.Invocation.GetConcreteMethodInvocationTarget()); proxy.Get(); GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(List <object>)); GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethodInvocationTarget(), typeof(List <object>)); Assert.AreNotEqual(interceptor.Invocation.GetConcreteMethod(), interceptor.Invocation.GetConcreteMethodInvocationTarget()); }
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 MethodInfoClosedInGenIfcNongenMethodRefTypeWithTarget() { KeepDataInterceptor interceptor = new KeepDataInterceptor(); IGenInterfaceHierarchyBase<List<object>> target = new GenInterfaceHierarchy<List<object>>(); IGenInterfaceHierarchyBase<List<object>> proxy = generator.CreateInterfaceProxyWithTarget<IGenInterfaceHierarchyBase<List<object>>>(target, interceptor); proxy.Add(null); GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(void), typeof(List<object>)); GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethodInvocationTarget(), typeof(void), typeof(List<object>)); Assert.AreNotEqual(interceptor.Invocation.GetConcreteMethod(), interceptor.Invocation.GetConcreteMethodInvocationTarget()); proxy.Get(); GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(List<object>)); GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethodInvocationTarget(), typeof(List<object>)); Assert.AreNotEqual(interceptor.Invocation.GetConcreteMethod(), interceptor.Invocation.GetConcreteMethodInvocationTarget()); }