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); }
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); }