Ejemplo n.º 1
0
 internal static void Bennies2(this ICollectionBe <Person> be)
 {
     be.Compose(persons =>
     {
         persons.ForEach(p =>
         {
             Expect(p).To.Be.A.Benny();
         });
     });
 }
Ejemplo n.º 2
0
 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");
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Tests if a collection is empty from the continuation
 /// </summary>
 /// <param name="be">ICollectionBe&lt;T&gt; 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"
                    ));
     });
 }