public void TestCleanup() { //Generic cleanup if (processor != null) { processor.ShutdownAsync().Wait(); processor = null; } }
public async Task TestSimpleSetup(BatchHandler <object, object> batchHandler, double minimumTimeIntervalMs = 1000, double maximumTimeIntervalMs = -1, int maximumCount = -1, UnprocessedItemAction unprocessedItemAction = UnprocessedItemAction.ReturnDefaultValue) { //Add an item to the queue, and then wait the minimum amount of time specified on the batch processor and check that our //item was processed processor = new BatchProcessor <object, object>(); processor.UnprocessedItemAction = unprocessedItemAction; if (!await processor.StartupAsync( batchHandler, TimeSpan.FromMilliseconds(minimumTimeIntervalMs), (maximumTimeIntervalMs == -1 ? TimeSpan.MaxValue : TimeSpan.FromMilliseconds(maximumTimeIntervalMs)), maximumCount)) { Assert.Inconclusive("Failed to startup batch processor"); } }