public void DisposeDoesNotThrowWhenCalledTwice() { var queue = new JobQueue <string>(GetEmptyProcessHandler <string>(), "dp", int.MaxValue, int.MaxValue, false, (message) => { }); queue.Dispose(); queue.Dispose(); }
public void ThrowsWhenFlushingAfterDisposed() { var queue = new JobQueue <string>(GetEmptyProcessHandler <string>(), "dp", int.MaxValue, int.MaxValue, false, (message) => { }); queue.Dispose(); Assert.ThrowsException <ObjectDisposedException>(() => { queue.Flush(); }); }
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(); } }
public void Dispose_Should_Call_Dispose_On_Queue() { _sut.Dispose(); _mockQueue.Verify(m => m.Dispose(), Times.Once()); }