예제 #1
0
 public void Should_replace_target_execution_result()
 {
     var target = new Foo();
     var interceptor = new OnReturnInterceptor("ack");
     var factory = new ProxyFactory(AppConfig.ProxyBehavior);
     var proxy = factory.Create<IFoo>(target, interceptor);
     proxy.Go();
     Assert.Equal("ack", proxy.Go());
     Assert.True(target.Executed);
 }
예제 #2
0
        public void Should_replace_target_execution_result()
        {
            var target      = new Foo();
            var interceptor = new OnReturnInterceptor("ack");
            var factory     = new ProxyFactory(AppConfig.ProxyBehavior);
            var proxy       = factory.Create <IFoo>(target, interceptor);

            proxy.Go();
            Assert.Equal("ack", proxy.Go());
            Assert.True(target.Executed);
        }