public void DoesNotLeakConnectionsForEachMessage()
        {
            // Low timeout + pool size will quickly show the issue.
            var cs        = ConnectionString + ";Connect Timeout = 5;Max Pool Size=10";
            var transport = new SqlServerMessageQueue(cs, TableName, InputQueueName);

            transport.EnsureTableIsCreated();
            transport.PurgeInputQueue();

            for (int i = 0; i < 100; i++)
            {
                using (var tx = new TransactionScope())
                {
                    var ctx = new AmbientTransactionContext();
                    transport.Send(InputQueueName, new TransportMessageToSend()
                    {
                        Body = new byte[0], Headers = new Dictionary <string, object>(), Label = "test"
                    }, ctx);
                    tx.Complete();
                }
            }
        }
 /// <summary>
 /// Creates the message table if a table with that name does not already exist
 /// </summary>
 public SqlServerMessageQueueOptions EnsureTableIsCreated()
 {
     sqlServerMessageQueue.EnsureTableIsCreated();
     return(this);
 }