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); }
protected override async Task ExecuteAsync(CancellationToken stoppingToken) { _consumer.Start(_queueName, WorkerCallBack); _logger.LogInformation("The consumer is ready..."); Console.ReadLine(); }