public void Limit_must_exhaust_a_source_if_n_greater_or_equal_accumulated_cost()
{
var input = new[] {"this", "is", "some", "string"};
var n = input.Length;
Func<string, long> costFunction = e => 1L;
var future = Source.From(input)
.LimitWeighted(n, costFunction)
.Grouped(1000)
.RunWith(Sink.FirstOrDefault<IEnumerable<string>>(), Materializer);
future.Wait(TimeSpan.FromMilliseconds(300)).Should().BeTrue();
future.Result.ShouldAllBeEquivalentTo(input);
}