public void integrated_test_with_the_expression()
        {
            var interceptor = new DecoratorInterceptor(typeof (IWidget), typeof (WidgetDecorator));

            var container = new Container(x => { x.For<IWidget>().Use<AWidget>().InterceptWith(interceptor); });

            container.GetInstance<IWidget>()
                .ShouldBeOfType<WidgetDecorator>()
                .Widget.ShouldBeOfType<AWidget>();
        }
        public void accept_visitor_for_DependencyInterceptor()
        {
            var target = new Target();
            var inner = Constant.For(target);

            var decorator = new DecoratorInterceptor(typeof(ITarget), typeof(DecoratedTarget));
            var plan = new InterceptionPlan(typeof(ITarget), inner, Policies.Default(), new IInterceptor[] { decorator });

            plan.AcceptVisitor(theVisitor);

            theVisitor.AssertWasCalled(x => x.Decorator(decorator));
        }
 public void accepts_type_is_the_plugin_type()
 {
     var interceptor = new DecoratorInterceptor(typeof (IWidget), typeof (WidgetDecorator));
     interceptor.Accepts.ShouldEqual(typeof (IWidget));
 }
 public void role_is_decorator()
 {
     var interceptor = new DecoratorInterceptor(typeof(IWidget), typeof(WidgetDecorator));
     interceptor.Role.ShouldEqual(InterceptorRole.Decorates);
 }