public void Any_Predicate_With_ValidData_Must_Succeed(int[] source, Func <int, bool> predicate) { // Arrange var wrapped = Wrap.AsValueReadOnlyCollection(source); var expected = System.Linq.Enumerable.Any(wrapped, predicate); // Act var result = ValueReadOnlyCollectionExtensions .Any <Wrap.ValueReadOnlyCollectionWrapper <int>, Wrap.Enumerator <int>, int>(wrapped, predicate); // Assert _ = result.Must() .BeEqualTo(expected); }
public void Any_PredicateAt_With_Null_Must_Throw() { // Arrange var source = new int[0]; var wrapped = Wrap.AsValueReadOnlyCollection(source); var predicate = (PredicateAt <int>)null; // Act Action action = () => _ = ValueReadOnlyCollectionExtensions .Any <Wrap.ValueReadOnlyCollectionWrapper <int>, Wrap.Enumerator <int>, int>(wrapped, predicate); // Assert _ = action.Must() .Throw <ArgumentNullException>() .EvaluateTrue(exception => exception.ParamName == "predicate"); }