public void WriteValidMessages(string message, TraceLevel logLevel, LogEventLevel expected)
        {
            // Arrange
            TraceEvent traceEvent = CreateTraceEvent(logLevel, message);

            // Act
            _sut.Trace(traceEvent);

            // Assert
            _loggerMock.Verify(l => l.Write(expected, default(Exception), message), Times.Once);
        }
        public void WriteToTheGlobalLoggerIfNoneSpecified()
        {
            // Arrange - Use a different constructor to test whether the global logger is used.
            var sut = new SerilogTraceWriter(TraceLevel.Info);

            // Set-up the global logger to be the mocked logger.
            Log.Logger = _loggerMock.Object;

            const string message    = "Some Random Message";
            TraceEvent   traceEvent = CreateTraceEvent(TraceLevel.Error, message);

            // Act
            sut.Trace(traceEvent);

            // Assert
            _loggerMock.Verify(l => l.Write(LogEventLevel.Error, default(Exception), message), Times.Once);
        }