示例#1
0
        public void Should_call_ShouldProcess_on_each_interceptor_and_return_true_ones()
        {
            var interceptorSource = new TypeParsingService(typeof(ITestInterface1));

            var found = interceptorSource.FindMatchingInterceptors(typeof(ITestInterface1).GetTypeInfo(),
                                                                   typeof(ITestInterface1).GetTypeInfo().GetMethod("Method2"));

            Assert.Equal(2, found.Count());
        }
示例#2
0
        public void Should_get_all_interceptors()
        {
            var interceptorSource = new TypeParsingService(typeof(ITestInterface1));

            var interceptors = interceptorSource.GetInterceptors().ToList();

            Assert.Equal(3, interceptors.Count);
            Assert.IsType <Interceptor1>(interceptors[0]);
            Assert.IsType <Interceptor3>(interceptors[1]);
            Assert.IsType <Interceptor2>(interceptors[2]);
        }