Пример #1
0
        public void When_Start_Consumer_Already_Started_Should_Return_Expected_Exception()
        {
            _consumer.Start(_processorMock.Object, QueueName);

            Action action = () => _consumer.Start(_processorMock.Object, QueueName);

            action.Should()
            .Throw <InvalidOperationException>()
            .WithMessage(Resources.ConsumerAlreadyStarted);
        }
Пример #2
0
        protected override async Task ExecuteAsync(CancellationToken stoppingToken)
        {
            _consumer.Start(_queueName, WorkerCallBack);

            _logger.LogInformation("The consumer is ready...");
            Console.ReadLine();
        }