コード例 #1
0
        public void Should_create_a_proxy_using_a_target_object_and_an_interceptor_that_validates_method_parameters()
        {
            IFoo target      = new Foo();
            var  interceptor = new NullArgumentInterceptor();            //-> Example of how to create an interceptor extending InterceptorBase
            var  factory     = new ProxyFactory(AppConfig.ProxyBehavior);
            var  proxy       = factory.Create(target, interceptor);

            Assert.Throws <ArgumentNullException>(() => proxy.GoTo(null));
        }
コード例 #2
0
ファイル: InterfaceProxyTester.cs プロジェクト: pablomx/Proxi
 public void Should_create_a_proxy_using_a_target_object_and_an_interceptor_that_validates_method_parameters()
 {
     IFoo target = new Foo();
     var interceptor = new NullArgumentInterceptor(); //-> Example of how to create an interceptor extending InterceptorBase
     var factory = new ProxyFactory(AppConfig.ProxyBehavior);
     var proxy = factory.Create(target, interceptor);
     Assert.Throws<ArgumentNullException>(() => proxy.GoTo(null));
 }