public void ProcessingQueueEnqueueOperationThrowsIfTaskCollectionContainsNull() { var queue = new ThrottledProcessingQueue(); Task[] tasks = new[] { new Task(() => { }), null, new Task(() => { }) }; Assert.Throws <ArgumentException>(() => queue.RegisterOperations(tasks)); }
public void ProcessingQueueStartsOperationIfProcessQueueIsNotFull() { bool operationProcessed = false; var queue = new ThrottledProcessingQueue(); Task operation = new Task(() => { operationProcessed = true; }); queue.RegisterOperations(new[] { operation }); operation.Wait(); Assert.IsTrue(operationProcessed); }
public void ProcessingQueueEnqueueOperationThrowsIfTasksCollectionIsNull() { var queue = new ThrottledProcessingQueue(); Assert.Throws <ArgumentNullException>(() => queue.RegisterOperations(null as Task[])); }