public void CanInterceptCallsToDerivedOfMBRO() { GlobalCountCallHandler.Calls.Clear(); IUnityContainer container = CreateContainer("CanInterceptCallsToDerivedOfMBRO") .RegisterType <DerivedWrappable>( new Interceptor <TransparentProxyInterceptor>(), new InterceptionBehavior <PolicyInjectionBehavior>()); DerivedWrappable wrappable = container.Resolve <DerivedWrappable>(); wrappable.Method2(); Assert.AreEqual(1, GlobalCountCallHandler.Calls["CanInterceptCallsToDerivedOfMBRO"]); }
public void InterfaceImplementationsOnDerivedClassesAreWrappedMultipleTimes() { GlobalCountCallHandler.Calls.Clear(); IUnityContainer container = CreateContainer( "InterfaceImplementationsOnDerivedClassesAreWrappedMultipleTimes") .RegisterType <DerivedWrappable>( new Interceptor <VirtualMethodInterceptor>(), new InterceptionBehavior <PolicyInjectionBehavior>()); DerivedWrappable wrappable = container.Resolve <DerivedWrappable>(); wrappable.Method(); Assert.AreEqual(1, GlobalCountCallHandler.Calls["InterfaceImplementationsOnDerivedClassesAreWrappedMultipleTimes"]); }
public void InterfaceImplementationsOnDerivedClassesAreWrappedMultipleTimes() { GlobalCountCallHandler.Calls.Clear(); IUnityContainer container = CreateContainer("InterfaceImplementationsOnDerivedClassesAreWrappedMultipleTimes"); container .Configure <Interception>() .SetInterceptorFor <DerivedWrappable>(new TransparentProxyInterceptor()); DerivedWrappable wrappable = container.Resolve <DerivedWrappable>(); wrappable.Method(); Assert.AreEqual(1, GlobalCountCallHandler.Calls["InterfaceImplementationsOnDerivedClassesAreWrappedMultipleTimes"]); }
public void CanInterceptCallsToDerivedOfMBRO() { GlobalCountCallHandler.Calls.Clear(); IUnityContainer container = CreateContainer("CanInterceptCallsToDerivedOfMBRO"); container .Configure <Interception>() .SetInterceptorFor <DerivedWrappable>(new TransparentProxyInterceptor()); DerivedWrappable wrappable = container.Resolve <DerivedWrappable>(); wrappable.Method2(); Assert.AreEqual(1, GlobalCountCallHandler.Calls["CanInterceptCallsToDerivedOfMBRO"]); }