public void MixinWithSameInterface_InterfaceWithTarget_AdditionalInterfaces_Derived() { ProxyGenerationOptions options = new ProxyGenerationOptions(); SimpleMixin mixin1 = new SimpleMixin(); options.AddMixinInstance(mixin1); StandardInterceptor interceptor = new StandardInterceptor(); var proxy = generator.CreateInterfaceProxyWithTarget(typeof(IService), new Type[] { typeof(IDerivedSimpleMixin) }, new ServiceImpl(), options, interceptor); Assert.AreEqual(1, (proxy as ISimpleMixin).DoSomething()); }
public void VirtualCallFromCtor() { StandardInterceptor interceptor = new StandardInterceptor(); ClassCallingVirtualMethodFromCtor proxy = generator.CreateClassProxy<ClassCallingVirtualMethodFromCtor>(interceptor); Assert.AreEqual(7, proxy.Result); }
public void TwoMixinsWithSameInterface() { ProxyGenerationOptions options = new ProxyGenerationOptions(); SimpleMixin mixin1 = new SimpleMixin(); OtherMixinImplementingISimpleMixin mixin2 = new OtherMixinImplementingISimpleMixin(); options.AddMixinInstance(mixin1); options.AddMixinInstance(mixin2); StandardInterceptor interceptor = new StandardInterceptor(); generator.CreateClassProxy(typeof(SimpleClass), options, interceptor); }