public void ShouldSuccessfullyStopNotExistsWorker()
        {
            // Given
            var target = new MessageQueueListener();

            // When
            TestDelegate action = () => target.StopListen("queue1");

            // Then
            Assert.DoesNotThrow(action);
        }
        public void ShouldStopSpecifiedWorkers()
        {
            // Given
            var worker1 = new Mock <IMessageQueueWorker>();
            var worker2 = new Mock <IMessageQueueWorker>();
            var target  = new MessageQueueListener();

            // When
            target.RegisterWorker("queue1", worker1.Object);
            target.RegisterWorker("queue2", worker2.Object);
            target.StartListenAll();
            target.StopListen("queue1");

            // Then
            worker1.Verify(m => m.Start(), Times.Once());
            worker1.Verify(m => m.Stop(), Times.Once());
            worker2.Verify(m => m.Start(), Times.Once());
            worker2.Verify(m => m.Stop(), Times.Never());
        }