Ejemplo n.º 1
0
        public void BasicInterfaceProxyWithValidTarget2()
        {
            LogInvocationInterceptor logger = new LogInvocationInterceptor();

            IService2 service = (IService2)
                                generator.CreateInterfaceProxyWithTarget(
                typeof(IService2), new Service2(), logger);

            service.DoOperation2();

            Assert.AreEqual("DoOperation2 ", logger.LogContents);
        }
Ejemplo n.º 2
0
        public void InterfaceTargetTypeProducesInvocationsThatCanChangeTarget()
        {
            LogInvocationInterceptor         logger            = new LogInvocationInterceptor();
            AssertCanChangeTargetInterceptor invocationChecker = new AssertCanChangeTargetInterceptor();

            IService2 service = (IService2)
                                generator.CreateInterfaceProxyWithTargetInterface(
                typeof(IService2), new Service2(), invocationChecker, logger);

            service.DoOperation2();

            Assert.AreEqual("DoOperation2 ", logger.LogContents);
        }