Example #1
0
        public void TruePolicyDecisionDoesntCallElseInterceptor(IInterceptionPolicy policy,
                                                                IInterceptor interceptor,
                                                                IInterceptor elseInterceptor,
                                                                IInvocation invocation)
        {
            var sut = new FilteringInterceptor(policy, interceptor, elseInterceptor);

            policy.ShouldIntercept(invocation).Returns(false);

            sut.Intercept(invocation);

            interceptor.DidNotReceive().Intercept(invocation);
        }
Example #2
0
        public void FalsePolicyDecisionCallsElseInterceptor(IInterceptionPolicy policy,
                                                            IInterceptor interceptor,
                                                            IInterceptor elseInterceptor,
                                                            IInvocation invocation)
        {
            var sut = new FilteringInterceptor(policy, interceptor, elseInterceptor);

            policy.ShouldIntercept(invocation).Returns(false);

            sut.Intercept(invocation);

            elseInterceptor.Received().Intercept(invocation);
        }