public void TraceLogsInformationAsInformation()
        {
            var loggerMock = new Mock <ILogger>();
            var writer     = new SerilogWebJobTraceWriter(loggerMock.Object);
            var trace      = new TraceEvent(TraceLevel.Info, "Hello");

            writer.Trace(trace);
            loggerMock.Verify(logger => logger.Information(It.IsAny <string>()), Times.Once, "because the correct log method should be called for the level");
        }
        public void TraceWithExceptionLogsAsAnError()
        {
            var loggerMock = new Mock <ILogger>();
            var writer     = new SerilogWebJobTraceWriter(loggerMock.Object);
            var expected   = new Exception();
            var trace      = new TraceEvent(TraceLevel.Verbose, "Hello");

            trace.Exception = expected;

            writer.Trace(trace);
            loggerMock.Verify(logger => logger.Error(It.Is <Exception>(ex => ex == expected), It.IsAny <string>(), It.IsAny <string>()), Times.Once, "because an exception should be error logged, regardless of level");
        }