示例#1
0
        public void ReturnsTrueWhenNoPolicies(IInvocation invocation)
        {
            var sut = new AndInterceptionPolicy();

            var result = sut.ShouldIntercept(invocation);

            result.Should().BeTrue();
        }
示例#2
0
        public void ReturnsValueOfSinglePolicy(bool expected, IInterceptionPolicy policy, IInvocation invocation)
        {
            policy.ShouldIntercept(invocation).Returns(expected);

            var sut = new AndInterceptionPolicy(policy);

            var result = sut.ShouldIntercept(invocation);

            result.Should().Be(expected);
        }
示例#3
0
        public void ReturnsAllOfMultiplePolicies(bool a, bool b, bool expected,
                                                 IInterceptionPolicy policyA,
                                                 IInterceptionPolicy policyB,
                                                 IInvocation invocation)
        {
            policyA.ShouldIntercept(invocation).Returns(a);
            policyB.ShouldIntercept(invocation).Returns(b);

            var sut = new AndInterceptionPolicy(policyA, policyB);

            var result = sut.ShouldIntercept(invocation);

            result.Should().Be(expected);
        }