public void Should_create_a_proxy_using_a_target_object_and_a_lambda() { var target = new Goo(); var factory = new ProxyFactory(AppConfig.ProxyBehavior); var proxy = factory.Create(target, mi => mi.Method.Invoke(mi.Target, mi.Arguments)); Assert.Equal("ack", proxy.Go()); }
public void Should_create_a_proxy_using_a_target_object_and_an_interceptor() { var interceptor = new ForwardExecutionInterceptor(); var target = new Goo(); var factory = new ProxyFactory(AppConfig.ProxyBehavior); var proxy = factory.Create(target, interceptor); Assert.Equal("ack", proxy.Go()); }