public async Task WhenProcessingOfMessageSuccessful_ShouldConsumeMessage()
            {
                // arrange

                var queueName     = "test-queue";
                var recievedBytes = new byte[0];
                Func <byte[], Task <bool> > action = (byte[] bytes) =>
                {
                    recievedBytes = bytes;
                    return(Task.FromResult(true));
                };

                var rabbitMqContext = new RabbitMqTestContextBuilder()
                                      .With_Queue(queueName)
                                      .Build();

                rabbitMqContext.PublishMessage(queueName, "hello_world");
                // act
                await rabbitMqContext.ConsumeMessage(queueName, action);

                // assert
                var expectedLength = 13; // len of 'hello_world'

                recievedBytes.Length.Should().Be(expectedLength);
            }
            public async Task WhenProcessingOfMessageErrors_ShouldNotAckMessage()
            {
                // arrange
                var queueName = "test-queue";
                Func <byte[], Task <bool> > action = (byte[] bytes) => Task.FromResult(false);

                var rabbitMqContext = new RabbitMqTestContextBuilder()
                                      .With_Queue(queueName)
                                      .Build();

                rabbitMqContext.PublishMessage(queueName, "hello_world");
                // act
                await rabbitMqContext.ConsumeMessage(queueName, action);

                // assert
                rabbitMqContext.Assert_Queue_Message_Count_Is(1);
            }
            public async Task WhenProcessingOfMessageSuccessful_ShouldAckMessage()
            {
                // arrange
                var queueName = "test-queue";
                Func <List <byte[]>, Task <bool> > action = (List <byte[]> bytes) => Task.FromResult(true);

                var rabbitMqContext = new RabbitMqTestContextBuilder()
                                      .With_Queue(queueName)
                                      .Build();

                for (var i = 0; i < 2; i++)
                {
                    rabbitMqContext.PublishMessage(queueName, "hello_world");
                }

                // act
                await rabbitMqContext.BatchConsumeMessage(queueName, 10, action);

                // assert
                rabbitMqContext.Assert_Queue_Message_Count_Is(0);
            }