public async Task BeforeEach() { _singleTaskBatcherTestSetup = new SingleTaskBatcherTestSetup(); _throwWhen = i => i % 2 == 0; _singleTaskBatcherTestSetup.ThrowWhen = _throwWhen; _batcher = _singleTaskBatcherTestSetup.GetBatcher(_synchronicity); _batcher.ExceptionEvent += (o, e) => _exceptionEvents.Add(e as BatchExceptionEventArguments <int>); _batcher.Process(_singleTaskBatcherTestSetup.StartItems); await _batcher.WaitUntilDone(); }
public async Task BeforeAll() { _singleTaskBatcherTestSetup = new SingleTaskBatcherTestSetup(); _batcher = _singleTaskBatcherTestSetup.GetBatcher(_synchronicity, _multiplicity); _batcher.ExceptionEvent += (o, e) => _exceptionEvents.Add(e as BatchExceptionEventArguments <int>); _batcher.Process(_singleTaskBatcherTestSetup.StartItems); await _batcher.WaitUntilDone(); await _singleTaskBatcherTestSetup.WaitUntil( s => s.ProcessedItems.Count >= s.StartItems.Count, s => s.ProcessedItems.GetMessage()); }