Esempio n. 1
0
        public void Example_of_how_to_create_an_interface_proxy_extending_InterceptorBase()
        {
            var target = new Foo();
            var interceptor = new InterceptorBaseImpl();
            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));
        }
Esempio n. 2
0
        public void Example_of_how_to_create_an_interface_proxy_extending_InterceptorBase()
        {
            var target      = new Foo();
            var interceptor = new InterceptorBaseImpl();
            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));
        }