public async Task BeginTransactionAsync_ThrowsInvalidOperationException_WhileTransactionActive()
        {
            // Arrange
            var provider = new SqlServerServiceBroker(connection);
            var transaction = default(IServiceBrokerTransaction);

            // Act
            Func<Task> call1 = async () =>
            {
                try
                {
                    provider.UseTransaction(connection.BeginTransaction());
                    transaction = await provider.BeginTransactionAsync();
                }
                finally
                {
                    provider.UseTransaction(null);
                }
            };

            Func<Task> call2 = async () =>
            {
                try
                {
                    transaction = await provider.BeginTransactionAsync();
                    transaction = await provider.BeginTransactionAsync();
                }
                finally
                {
                    provider.UseTransaction(null);
                }
            };

            // Assert
            await Assert.ThrowsAsync<InvalidOperationException>(call1);
            Assert.Null(transaction);
            await Assert.ThrowsAsync<InvalidOperationException>(call2);
            Assert.NotNull(transaction);
        }