public async Task ShouldBatchAllItemsTogether() { var processor = new IntProcessor(); await TestAsync(options => options .MaximumQueueCountBeforeAutoFlush(5) .AddProcessorSingleton <int, IntProcessor>(processor), async http => { var ids = Enumerable.Range(0, 5); await Task.WhenAll(ids.Select(id => http.GetAsync($"/{id}"))); WaitOrThrow(processor.Event, 500); var batch = Assert.Single(processor.Batches); Assert.Equal(ids, batch.Items.OrderBy(x => x)); }); }
public void GivenIsAnIntProcessor(string key) { IValueProcessor processor = new IntProcessor(_scenario); _scenario.Set(processor, key); }