public void Should_run_a_callback_after_target_execution() { bool ack = false; var target = new Foo(); var interceptor = new OnAfterInterceptor{ Action = ()=> { Assert.True(target.Executed); ack = true; } }; var factory = new ProxyFactory(AppConfig.ProxyBehavior); var proxy = factory.Create<IFoo>(target, interceptor); proxy.Go(); Assert.True(ack); }
public void Should_run_a_callback_after_target_execution() { bool ack = false; var target = new Foo(); var interceptor = new OnAfterInterceptor { Action = () => { Assert.True(target.Executed); ack = true; } }; var factory = new ProxyFactory(AppConfig.ProxyBehavior); var proxy = factory.Create <IFoo>(target, interceptor); proxy.Go(); Assert.True(ack); }