public void ReturnsTrueWhenNoPolicies(IInvocation invocation) { var sut = new AndInterceptionPolicy(); var result = sut.ShouldIntercept(invocation); result.Should().BeTrue(); }
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); }
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); }