static async Task <int> DoRollbackAllAndDisposeTestAsync(ISqlConnectionTransactionController controller, int tranCount, int messageId)
        {
            var message = Guid.NewGuid().ToString();

            using (var tran = controller.BeginTransaction())
            {
                tran.Status.Should().Be(SqlTransactionStatus.Opened);
                controller.TransactionCount.Should().Be(tranCount + 1);
                (await AddMessageAsync(controller, message)).Should().Be(++messageId);
                (await ReadMessageAsync(controller, messageId)).Should().Be(message);
                tran.RollbackAll();
                controller.TransactionCount.Should().Be(0);
                tran.Status.Should().Be(SqlTransactionStatus.Rollbacked);
            }
            (await ReadMessageAsync(controller, 2)).Should().BeNull();
            message = Guid.NewGuid().ToString();
            using (var tran = controller.BeginTransaction())
            {
                tran.Status.Should().Be(SqlTransactionStatus.Opened);
                controller.TransactionCount.Should().Be(1);
                (await AddMessageAsync(controller, message)).Should().Be(++messageId);
                (await ReadMessageAsync(controller, messageId)).Should().Be(message);
            }
            controller.TransactionCount.Should().Be(0);
            (await ReadMessageAsync(controller, messageId)).Should().BeNull();
            return(messageId);
        }
        static async Task <int> DoCommitTestAsync(ISqlConnectionTransactionController controller, int tranCount, int messageId)
        {
            var message = Guid.NewGuid().ToString();

            using (var tran = controller.BeginTransaction())
            {
                tran.Status.Should().Be(SqlTransactionStatus.Opened);
                controller.TransactionCount.Should().Be(tranCount + 1);
                (await AddMessageAsync(controller, message)).Should().Be(++messageId);
                (await ReadMessageAsync(controller, messageId)).Should().Be(message);
                tran.Commit();
                controller.TransactionCount.Should().Be(tranCount);
                tran.Status.Should().Be(SqlTransactionStatus.Committed);
            }
            (await ReadMessageAsync(controller, messageId)).Should().Be(message);
            return(messageId);
        }
        static int DoCommitTest(ISqlConnectionTransactionController controller, int tranCount, int messageId)
        {
            var message = Guid.NewGuid().ToString();

            using (var tran = controller.BeginTransaction())
            {
                tran.Status.Should().Be(SqlTransactionStatus.Opened);
                controller.TransactionCount.Should().Be(tranCount + 1);
                AddMessage(controller, message).Should().Be(++messageId);
                ReadMessage(controller, messageId).Should().Be(message);
                tran.Commit();
                controller.TransactionCount.Should().Be(tranCount);
                tran.Status.Should().Be(SqlTransactionStatus.Committed);
            }
            ReadMessage(controller, messageId).Should().Be(message);
            return(messageId);
        }