예제 #1
0
        public void Castle_behavior_does_not_support_class_proxies_without_default_ctor()
        {
            var hoo = new Hoo("Hoo", 1);
            var interceptor = new ForwardExecutionInterceptor();
            var castle = new ProxyFactory(ProxyBehavior.Castle);
            Assert.Throws <System.ArgumentException>(() => castle.Create<Hoo>(hoo, interceptor));

            // linfu does...
            var linfu = new ProxyFactory(ProxyBehavior.LinFu);
            Assert.Same("Hoo",linfu.Create<Hoo>(hoo, interceptor).Name);

            // spring does...
            var spring = new ProxyFactory(ProxyBehavior.Spring);
            Assert.Same("Hoo", spring.Create<Hoo>(hoo, interceptor).Name);
        }
예제 #2
0
        public void Castle_behavior_does_not_support_class_proxies_without_default_ctor()
        {
            var hoo         = new Hoo("Hoo", 1);
            var interceptor = new ForwardExecutionInterceptor();
            var castle      = new ProxyFactory(ProxyBehavior.Castle);

            Assert.Throws <System.ArgumentException>(() => castle.Create <Hoo>(hoo, interceptor));

            // linfu does...
            var linfu = new ProxyFactory(ProxyBehavior.LinFu);

            Assert.Same("Hoo", linfu.Create <Hoo>(hoo, interceptor).Name);

            // spring does...
            var spring = new ProxyFactory(ProxyBehavior.Spring);

            Assert.Same("Hoo", spring.Create <Hoo>(hoo, interceptor).Name);
        }