public void SetUp()
        {
            _interceptor1 = new MockTypeInterceptor(typeof(string));
            _interceptor2 = new MockTypeInterceptor(typeof(int), typeof(double));
            _interceptor3 = new MockTypeInterceptor(typeof(string), typeof(bool));
            _interceptor4 = new MockTypeInterceptor(typeof(string), typeof(double));

            _library = new InterceptorLibrary();
            _library.AddInterceptor(_interceptor1);
            _library.AddInterceptor(_interceptor2);
            _library.AddInterceptor(_interceptor3);
            _library.AddInterceptor(_interceptor4);
        }
        public void Import_from_gets_all_interceptors_and_resets_the_type_filter()
        {
            var sourceLibrary = new InterceptorLibrary();

            sourceLibrary.AddInterceptor(new MockTypeInterceptor(typeof(string)));
            sourceLibrary.FindInterceptor(typeof(string));

            var destinationLibrary = new InterceptorLibrary();

            destinationLibrary.AddInterceptor(new MockTypeInterceptor(typeof(string)));

            destinationLibrary.ImportFrom(sourceLibrary);

            InstanceInterceptor[] interceptors = destinationLibrary.FindInterceptors(typeof(string));
            Assert.AreEqual(2, interceptors.Length);
        }
        When_Interceptors_Are_Requested_For_A_Type_For_The_First_Time_The_Library_Will_Scan_All_The_TypeInterceptors
            ()
        {
            var mocks        = new MockRepository();
            var interceptor1 = mocks.StrictMock <TypeInterceptor>();
            var interceptor2 = mocks.StrictMock <TypeInterceptor>();
            var interceptor3 = mocks.StrictMock <TypeInterceptor>();

            _library.AddInterceptor(interceptor1);
            _library.AddInterceptor(interceptor2);
            _library.AddInterceptor(interceptor3);

            Type type = typeof(string);

            Expect.Call(interceptor1.MatchesType(type)).Return(true);
            Expect.Call(interceptor2.MatchesType(type)).Return(true);
            Expect.Call(interceptor3.MatchesType(type)).Return(true);

            mocks.ReplayAll();
            _library.FindInterceptors(type);
            mocks.VerifyAll();
        }