public void ApplyTo_FirstItemDoesNotMatchConstraint_SubsequentConstraintsNotEvaluated() { Constraint failing = Substitute.For<Constraint>(), notEvaluated = Substitute.For<Constraint>(); var subject = new ConstrainedEnumerable(failing, notEvaluated); failing.ApplyTo(-1).Returns(new ConstraintResult(null, null, false)); subject.ApplyTo(new[] { -1, 2 }); notEvaluated.DidNotReceive().ApplyTo(Arg.Any<int>()); }
public void ApplyTo_FirstItemDoesNotMatchConstraint_SubsequentConstraintsNotEvaluated() { Constraint failing = Substitute.For <Constraint>(), notEvaluated = Substitute.For <Constraint>(); var subject = new ConstrainedEnumerable(failing, notEvaluated); failing.ApplyTo(-1).Returns(new ConstraintResult(null, null, false)); subject.ApplyTo(new[] { -1, 2 }); notEvaluated.DidNotReceive().ApplyTo(Arg.Any <int>()); }
public void apply_SecondItemDoesNotMatchConstraint_SubsequentConstraintsNotEvaluated() { Constraint passing = Substitute.For<Constraint>(), failing = Substitute.For<Constraint>(), notEvaluated = Substitute.For<Constraint>(); var subject = new ConstrainedEnumerable(failing, notEvaluated); passing.ApplyTo(1).Returns(new ConstraintResult(null, null, false)); failing.ApplyTo(-2).Returns(new ConstraintResult(null, null, false)); subject.ApplyTo(new[] { 1, -2, 3 }); notEvaluated.DidNotReceive().ApplyTo(Arg.Any<int>()); }
public void apply_SecondItemDoesNotMatchConstraint_SubsequentConstraintsNotEvaluated() { Constraint passing = Substitute.For <Constraint>(), failing = Substitute.For <Constraint>(), notEvaluated = Substitute.For <Constraint>(); var subject = new ConstrainedEnumerable(failing, notEvaluated); passing.ApplyTo(1).Returns(new ConstraintResult(null, null, false)); failing.ApplyTo(-2).Returns(new ConstraintResult(null, null, false)); subject.ApplyTo(new[] { 1, -2, 3 }); notEvaluated.DidNotReceive().ApplyTo(Arg.Any <int>()); }