public void Proxy_with_method_with_nested_generic_parameter() { var interceptors = new SetReturnValueInterceptor(null); var proxy = generator.CreateInterfaceProxyWithoutTarget<GenInterfaceWithMethodWithNestedGenericParameter>(interceptors); proxy.Foo<int>(null); }
public void Proxy_with_method_with_nested_generic_parameter_by_ref() { var interceptors = new SetReturnValueInterceptor(null); var proxy = generator.CreateInterfaceProxyWithoutTarget<GenInterfaceWithMethodWithNestedGenericParameterByRef>(interceptors); IEnumerable<IComparable<int>> param = null; proxy.Foo<int>(ref param); }
public void ClassImplementingInterfaceVitrually() { var @class = typeof (ClassWithVirtualInterface); var @interface = typeof(ISimpleInterface); var baseMethod = @class.GetMethod("Do"); var interceptor = new SetReturnValueInterceptor(123); var proxy = generator.CreateClassProxy(@class, new[] {@interface}, interceptor); var mapping = proxy.GetType().GetInterfaceMap(@interface); Assert.AreEqual(mapping.TargetMethods[0].GetBaseDefinition(), baseMethod); Assert.AreEqual(123, (proxy as ClassWithVirtualInterface).Do()); Assert.AreEqual(123, (proxy as ISimpleInterface).Do()); }