Esempio n. 1
0
        public void DisposeDoesNotThrowWhenCalledTwice()
        {
            var queue = new JobQueue <string>(GetEmptyProcessHandler <string>(), "dp", int.MaxValue, int.MaxValue, false, (message) => { });

            queue.Dispose();
            queue.Dispose();
        }
Esempio n. 2
0
        public void ThrowsWhenFlushingAfterDisposed()
        {
            var queue = new JobQueue <string>(GetEmptyProcessHandler <string>(), "dp", int.MaxValue, int.MaxValue, false, (message) => { });

            queue.Dispose();

            Assert.ThrowsException <ObjectDisposedException>(() =>
            {
                queue.Flush();
            });
        }
Esempio n. 3
0
        public void ThrowsWhenBeingDisposedWhileQueueIsPaused()
        {
            using (var queue = new JobQueue <string>(GetEmptyProcessHandler <string>(), "dp", int.MaxValue, int.MaxValue, false, (message) => { }))
            {
                queue.Pause();

                Assert.ThrowsException <InvalidOperationException>(() =>
                {
                    queue.Dispose();
                });

                queue.Resume();
            }
        }
Esempio n. 4
0
        public void Dispose_Should_Call_Dispose_On_Queue()
        {
            _sut.Dispose();

            _mockQueue.Verify(m => m.Dispose(), Times.Once());
        }