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

            Assert.IsNotNull(proxied);
        }
Beispiel #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());
        }
Beispiel #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);
        }
        public void BehaviorAddsInterface()
        {
            var target = new MockDal();
            var proxied = Intercept.ThroughProxy(target,
                new TransparentProxyInterceptor(),
                new[] { new AdditionalInterfaceBehavior() });

            Assert.IsNotNull(proxied as IAdditionalInterface);
            
        }