Exemplo n.º 1
0
        public void CanProxyWithBehaviorThatAddsInterface()
        {
            var target = new MockDal();
            var proxied = Intercept.ThroughProxy<IDal>(target,
                new InterfaceInterceptor(),
                new[] { new AdditionalInterfaceBehavior() });

            Assert.IsNotNull(proxied);
        }
Exemplo n.º 2
0
        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());
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        public void BehaviorAddsInterface()
        {
            var target = new MockDal();
            var proxied = Intercept.ThroughProxy(target,
                new TransparentProxyInterceptor(),
                new[] { new AdditionalInterfaceBehavior() });

            Assert.IsNotNull(proxied as IAdditionalInterface);
            
        }