public void CanProxyWithBehaviorThatAddsInterface() { var target = new MockDal(); var proxied = Intercept.ThroughProxy<IDal>(target, new InterfaceInterceptor(), new[] { new AdditionalInterfaceBehavior() }); Assert.IsNotNull(proxied); }
public void CanInvokeMethodOnManuallyAddedInterface() { var target = new MockDal(); var proxied = Intercept.ThroughProxyWithAdditionalInterfaces<IDal>(target, new InterfaceInterceptor(), new[] { new AdditionalInterfaceBehavior(false) }, new[] { typeof(IAdditionalInterface) }); Assert.AreEqual(10, ((IAdditionalInterface)proxied).DoNothing()); }
public void CanManuallyAddAdditionalInterface() { var target = new MockDal(); var proxied = Intercept.ThroughProxyWithAdditionalInterfaces<IDal>(target, new InterfaceInterceptor(), new[] { new AdditionalInterfaceBehavior(false) }, new[] { typeof(IAdditionalInterface) }); Assert.IsNotNull(proxied as IAdditionalInterface); }
public void BehaviorAddsInterface() { var target = new MockDal(); var proxied = Intercept.ThroughProxy(target, new TransparentProxyInterceptor(), new[] { new AdditionalInterfaceBehavior() }); Assert.IsNotNull(proxied as IAdditionalInterface); }