public static async Task executes_supplied_action() { var total = new ConcurrentBag <int>(); await PopulatedEnumerable.ForEachAsync(3, x => { total.Add(int.Parse(x, CultureInfo.InvariantCulture)); return(Task.CompletedTask); }).ForAwait(); total.Sum().ShouldBe(6); }
public static void materializes_the_enumerable() { PopulatedEnumerable.Materialize().Count.ShouldBe(3); }
public static Task throws_on_null_action() { return(Should.ThrowAsync <ArgumentNullException>(() => PopulatedEnumerable.ForEachAsync(1, null !))); }
public static void does_not_filter_populated_items() { PopulatedEnumerable.WhereNotNull().ShouldBe(PopulatedEnumerable); }