public void CanCreateWrappedObject() { IConfigurationSource configurationSource = CreateConfigurationSource("CanCreateWrappedObject"); Wrappable wrappable = PolicyInjection.Create <Wrappable>(configurationSource); Assert.IsNotNull(wrappable); Assert.IsTrue(RemotingServices.IsTransparentProxy(wrappable)); }
public void CanCreateWrappedObject() { SetupContainer("CanCreateWrappedObject"); Wrappable wrappable = PolicyInjection.Create <Wrappable>(); Assert.IsNotNull(wrappable); Assert.IsTrue(RemotingServices.IsTransparentProxy(wrappable)); }
public void WhenInjectorWrapsInstanceOfWrappableType_ThenMethodCallsAreIntercepted() { Wrappable wrappable = this.policyInjector.Wrap <Wrappable>(new Wrappable()); wrappable.Method(); wrappable.Method(); wrappable.Method3(); Assert.AreEqual(3, this.handler.CallCount); }
public void CanInterceptCallsToMBROOverInterface() { SetupContainer("CanInterceptCallsToMBROOverInterface"); Wrappable wrappable = PolicyInjection.Create <Wrappable>(); ((Interface)wrappable).Method(); Assert.AreEqual(1, GlobalCountCallHandler.Calls["CanInterceptCallsToMBROOverInterface"]); }
public void CanInterceptWrappedObjectWithNonGenericMethods() { SetupContainer("CanCreateWrappedObject"); Wrappable wrappable = (Wrappable)PolicyInjection.Create(typeof(Wrappable)); wrappable.Method2(); Assert.AreEqual(1, GlobalCountCallHandler.Calls["CanCreateWrappedObject"]); }
public void CanInterceptWrappedObject() { SetupContainer("CanCreateWrappedObject"); Wrappable wrappable = PolicyInjection.Create <Wrappable>(); wrappable.Method2(); Assert.AreEqual(1, GlobalCountCallHandler.Calls["CanCreateWrappedObject"]); }
public void WhenInjectorWrapsInstanceOfWrappableType_ThenMethodCallsAreInterceptedAccordingToThePolicyInjectionRulesInTheConfigurationSource() { Wrappable wrappable = this.policyInjector.Wrap <Wrappable>(new Wrappable()); wrappable.Method(); wrappable.Method(); wrappable.Method3(); Assert.AreEqual(1, GlobalCountCallHandler.Calls.Count); Assert.AreEqual(3, GlobalCountCallHandler.Calls["counter"]); }
public void CanInterceptCallsToMBROOverInterface() { GlobalCountCallHandler.Calls.Clear(); IConfigurationSource configurationSource = CreateConfigurationSource("CanInterceptCallsToMBROOverInterface"); Wrappable wrappable = PolicyInjection.Create <Wrappable>(configurationSource); ((Interface)wrappable).Method(); Assert.AreEqual(1, GlobalCountCallHandler.Calls["CanInterceptCallsToMBROOverInterface"]); }
public void CanInterceptWrappedObject() { GlobalCountCallHandler.Calls.Clear(); IConfigurationSource configurationSource = CreateConfigurationSource("CanCreateWrappedObject"); Wrappable wrappable = PolicyInjection.Create <Wrappable>(configurationSource); wrappable.Method2(); Assert.AreEqual(1, GlobalCountCallHandler.Calls["CanCreateWrappedObject"]); }