Exemple #1
0
        public void Example_of_how_to_create_an_interface_proxy_implementign_IInterceptor()
        {
            var target = new Foo();
            var interceptor = new IInterceptorImpl();
            var factory = new ProxyFactory(ProxyBehavior.Castle);
            var foo = factory.Create<IFoo>(target, interceptor);

            foo.Go("SLC");
            foo.Go("SLC", "MEX");
            Assert.Throws<ArgumentNullException>(() => foo.Go("SLC", null));
        }
Exemple #2
0
        public void Example_of_how_to_create_an_interface_proxy_implementign_IInterceptor()
        {
            var target      = new Foo();
            var interceptor = new IInterceptorImpl();
            var factory     = new ProxyFactory(ProxyBehavior.Castle);
            var foo         = factory.Create <IFoo>(target, interceptor);

            foo.Go("SLC");
            foo.Go("SLC", "MEX");
            Assert.Throws <ArgumentNullException>(() => foo.Go("SLC", null));
        }