public void OnTransactionCommitting()
        {
            // arrange
            var isolationLevel = IsolationLevel.Chaos;
            var connection     = Mock.Of <DbConnection>();
            var transaction    = Mock.Of <DbTransaction>();
            var source         = new DbDiagnosticListener();
            var operationId    = Guid.Empty;

            // act
            var(eventName, payload) = DbDiagnosticSession.Execute(source,
                                                                  () =>
            {
                operationId =
                    source.OnTransactionCommitting(isolationLevel, connection, transaction, "operation");
            });

            // assert
            Assert.Equal("System.Data.Common.TransactionCommitting", eventName);
            var transactionPayload = Assert.IsType <TransactionPayload>(payload);

            Assert.Equal(transaction.GetId(), transactionPayload.TransactionId);
            Assert.Equal(connection, transactionPayload.Connection);
            Assert.Equal(isolationLevel, transactionPayload.IsolationLevel);
            Assert.Equal(operationId, transactionPayload.OperationId);
            Assert.Equal("operation", transactionPayload.Operation);
            Assert.Null(transactionPayload.Exception);
        }
        public void OnTransactionCommitting_IsNotEnabled()
        {
            // arrange
            var isolationLevel = IsolationLevel.Chaos;
            var connection     = Mock.Of <DbConnection>();
            var transaction    = Mock.Of <DbTransaction>();
            var source         = new DbDiagnosticListener();

            // act
            var operationId = source.OnTransactionCommitting(isolationLevel, connection, transaction, "operation");

            // assert
            Assert.Equal(Guid.Empty, operationId);
        }