public void TransparentProxyInterceptionWithSingleBehaviourWillExecuteFalse() { MBROTarget objectToIntercept = new MBROTarget(); MBROTarget proxy = Intercept.ThroughProxy <MBROTarget>(objectToIntercept, new TransparentProxyInterceptor(), new IInterceptionBehavior[] { new TestBehaviour("behaviour1", false) }); string result = String.Empty; proxy.TargetMethod(ref result); Assert.AreEqual <string>("inside target", result); }
public void InterafaceInterceptionWithMultipleBehaviourWillExecuteFalse() { ITarget objectToIntercept = new MBROTarget(); ITarget proxy = Intercept.ThroughProxy <ITarget>(objectToIntercept, new InterfaceInterceptor(), new IInterceptionBehavior[] { new TestBehaviour("behaviour1", true), new TestBehaviour("behaviour2", false), new TestBehaviour("behaviour3", false) }); string result = String.Empty; proxy.TargetMethod(ref result); Assert.AreEqual <string>("behaviour1preinside targetbehaviour1post", result); }
public void TransparentProxyInterceptionWithSingleBehaviourWillExecuteFalse() { MBROTarget objectToIntercept = new MBROTarget(); MBROTarget proxy = Intercept.ThroughProxy<MBROTarget>(objectToIntercept, new TransparentProxyInterceptor(), new IInterceptionBehavior[] { new TestBehaviour("behaviour1", false) }); string result = String.Empty; proxy.TargetMethod(ref result); Assert.AreEqual<string>("inside target", result); }
public void InterafaceInterceptionWithMultipleBehaviourWillExecuteFalse() { ITarget objectToIntercept = new MBROTarget(); ITarget proxy = Intercept.ThroughProxy<ITarget>(objectToIntercept, new InterfaceInterceptor(), new IInterceptionBehavior[] { new TestBehaviour("behaviour1", true), new TestBehaviour("behaviour2", false), new TestBehaviour("behaviour3", false) }); string result = String.Empty; proxy.TargetMethod(ref result); Assert.AreEqual<string>("behaviour1preinside targetbehaviour1post", result); }