示例#1
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);
        }
示例#2
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);
        }
示例#3
0
 public void SutIsInterceptor(FilteringInterceptor sut)
 {
     sut.Should().BeAssignableTo <IInterceptor>();
 }