//[TestCase(100, 10, 1)]
        //[TestCase(100, 10, 2)]
        //[TestCase(100, 10, 3)]
        //[TestCase(100, 10, 4)]
        //[TestCase(100, 10, 5)]
        //[TestCase(100, 10, 6)]
        //[TestCase(100, 10, 7)]
        //[TestCase(100, 10, 8)]
        //[TestCase(100, 10, 9)]
        //[TestCase(100, 10, 10)]
        //[TestCase(500, 50, 11)]
        //[TestCase(500, 50, 12)]
        //[TestCase(500, 50, 13)]
        //[TestCase(500, 50, 14)]
        //[TestCase(500, 50, 15)]
        public async Task Time_For_Batch_Transport_To_Clear_Queue(int batchSize, int delayInSeconds, int testIndex)
        {
            Console.WriteLine($"Test: #{testIndex}, batch size: {batchSize}");
            var visibleTime = DateTime.UtcNow.AddSeconds(delayInSeconds);

            await SendMessages(batchSize, visibleTime, config.GetBatchServiceEndpointName()).ConfigureAwait(false);

            var endTime = DateTime.Now.AddSeconds(delayInSeconds).Add(config.GetTimeToWait());

            Console.WriteLine($"Waiting until {endTime:G} for NSB service to finish storing the messages.");

            var connection = new ServiceBusConnection(config.ServiceBusConnectionString);
            var client     = new ManagementClient(config.ServiceBusConnectionString);

            while (DateTime.Now < endTime)
            {
                var queueInfo = await client.GetQueueRuntimeInfoAsync(config.GetBatchServiceEndpointName())
                                .ConfigureAwait(false);

                Console.WriteLine($"Time: {DateTime.Now:G}. Queue count: {queueInfo.MessageCount}, Active messages: {queueInfo.MessageCountDetails.ActiveMessageCount}, Dead letter: {queueInfo.MessageCountDetails.DeadLetterMessageCount}, Scheduled: {queueInfo.MessageCountDetails.ScheduledMessageCount}");
                if (DateTime.UtcNow > visibleTime && queueInfo.MessageCount == 0)
                {
                    var executionTime = DateTime.UtcNow - visibleTime;
                    Console.WriteLine($"Time: {DateTime.Now:G}. Took: {executionTime.TotalSeconds} seconds to clear {batchSize} messages");
                    Assert.Pass();
                }
                await Task.Delay(TimeSpan.FromMilliseconds(250));
            }
            Assert.Fail("Failed to process all messages.");
        }