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);
        }
 public void ThrowsOnNullInvocation(AndInterceptionPolicy sut)
 {
     sut.Invoking(s => s.ShouldIntercept(null))
         .ShouldThrow<ArgumentNullException>();
 }
 public void SutIsInterceptionPolicy(AndInterceptionPolicy sut)
 {
     sut.Should().BeAssignableTo<IInterceptionPolicy>();
 }