public void MixinImplementingMoreThanOneInterface() { ProxyGenerationOptions proxyGenerationOptions = new ProxyGenerationOptions(); ComplexMixin mixin_instance = new ComplexMixin(); proxyGenerationOptions.AddMixinInstance(mixin_instance); AssertInvocationInterceptor interceptor = new AssertInvocationInterceptor(); object proxy = generator.CreateClassProxy( typeof(SimpleClass), proxyGenerationOptions, interceptor ); Assert.IsNotNull(proxy); Assert.IsTrue(typeof(SimpleClass).IsAssignableFrom(proxy.GetType())); Assert.IsFalse(interceptor.Invoked); IThird inter3 = proxy as IThird; Assert.IsNotNull(inter3); inter3.DoThird(); Assert.IsTrue(interceptor.Invoked); Assert.AreSame(proxy, interceptor.proxy); Assert.AreSame(mixin_instance, interceptor.mixin); ISecond inter2 = proxy as ISecond; Assert.IsNotNull(inter2); inter2.DoSecond(); Assert.IsTrue(interceptor.Invoked); Assert.AreSame(proxy, interceptor.proxy); Assert.AreSame(mixin_instance, interceptor.mixin); IFirst inter1 = proxy as IFirst; Assert.IsNotNull(inter1); inter1.DoFirst(); Assert.IsTrue(interceptor.Invoked); Assert.AreSame(proxy, interceptor.proxy); Assert.AreSame(mixin_instance, interceptor.mixin); }
public ObjectB(IThird child) { this.Child = child; }
public OverloadedTestClass(IFirst first, ISecond second, IThird third) { _first = first; _second = second; _third = third; }
public OverloadedTestClass(IFirst first, ISecond second, IThird third) { _first = first; _second = second; _third = third; }