internal static void Bennies2(this ICollectionBe <Person> be) { be.Compose(persons => { persons.ForEach(p => { Expect(p).To.Be.A.Benny(); }); }); }
internal static void Bennies(this ICollectionBe <Person> be) { be.Compose(persons => { persons.ForEach(p => { Expect(p).To.Be.A.Benny(); }); }, (collection, passed) => $"Expected {MessageHelpers.Stringify(collection)} {passed.AsNot()}to all be Bennies"); }
/// <summary> /// Tests if a collection is empty from the continuation /// </summary> /// <param name="be">ICollectionBe<T> continuation</param> /// <typeparam name="T">Item type of the collection being tested</typeparam> public static void Empty <T>( this ICollectionBe <T> be ) { be.AddMatcher(collection => { var passed = collection != null && !collection.Any(); var not = passed ? "not " : ""; return(new MatcherResult( passed, $"Expected {CollectionPrint(collection)} {not}to be an empty collection" )); }); }