public CacheServiceRegistry(SmartInstance <TConcreteType, TPluginType> smartInstance)
 {
     smartInstance.AddInterceptor(new DynamicProxyInterceptor <TPluginType>(new IInterceptionBehavior[]
     {
         new CachingInterceptor(),
         new CacheInvalidateInterceptor(),
     }));
 }
        public void add_interceptor()
        {
            var interceptor =
                new ActivatorInterceptor <SimpleWidget>(w => w.Intercept());
            var instance = new SmartInstance <SimpleWidget>();

            instance.AddInterceptor(interceptor);

            new Container().GetInstance <SimpleWidget>(instance)
            .WasIntercepted.ShouldBeTrue();
        }
        public void add_interceptor()
        {
            var interceptor =
                new ActivatorInterceptor<SimpleWidget>(w => w.Intercept());
            var instance = new SmartInstance<SimpleWidget>();

            instance.AddInterceptor(interceptor);

            new Container().GetInstance<SimpleWidget>(instance)
                .WasIntercepted.ShouldBeTrue();
        }