public void SmartProcessingQueueEnqueueOperationThrowsIfTaskCollectionContainsNull()
        {
            var queue = new SmartThrottledProcessingQueue();

            Task[] tasks = new[] { new Task(() => { }), null, new Task(() => { }) };

            Assert.Throws <ArgumentException>(() => queue.RegisterOperations(tasks));
        }
        public void SmartProcessingQueueStartsOperationIfProcessQueueIsNotFull()
        {
            bool operationProcessed = false;

            var queue = new SmartThrottledProcessingQueue();

            Task operation = new Task(() =>
            {
                operationProcessed = true;
            });

            queue.RegisterOperations(new[] { operation });

            operation.Wait();

            Assert.IsTrue(operationProcessed);
        }
        public void SmartProcessingQueueEnqueueOperationThrowsIfTasksCollectionIsNull()
        {
            var queue = new SmartThrottledProcessingQueue();

            Assert.Throws <ArgumentNullException>(() => queue.RegisterOperations(null as Task[]));
        }