public async Task ConsumerStartAsync_WithQueueName_QueueExists() { var builder = RabbitMQTestBuilder .CreateWithoutQueueDeclare(_fixture) .WithConsumerCallback((_, _) => Task.FromResult(ProcessedMessageStatus.Success)) .Build(); var consumer = builder.GetConsumer <string>(); await consumer.StartAsync(); Assert.True(builder.IsConsumerQueueDeclared()); }
public async Task ConsumerStartAsync_OneMessageInQueueAndConsumeCallbackSuccess_QueueEmptyAfterAck() { var builder = RabbitMQTestBuilder .CreateWithoutQueueDeclare(_fixture) .WithSingleRandomPublishedMessage() .WithConsumerCallback((_, _) => Task.FromResult(ProcessedMessageStatus.Success)) .Build(); var consumer = builder.GetConsumer <string>(); await consumer.StartAsync(); await Task.Delay(TimeSpan.FromSeconds(2)); Assert.Equal((uint)0, builder.MessageInConsumerQueue()); }