public void BuildTraceEvent_NullFormatter() { LogEvent logEvent = LogEventHelper.GetLogEvent(); TraceEvent traceEvent = TraceWriterSink.BuildTraceEvent(logEvent, null); Assert.Null(traceEvent); }
public void BuildTraceEvent_NullLogEvent() { ITextFormatter formatter = new RawFormatter(); TraceEvent traceEvent = TraceWriterSink.BuildTraceEvent(null, formatter); Assert.Null(traceEvent); }
public void BuildTraceEvent() { string message = "PlainMessageTemplate"; LogEventLevel logEventLevel = LogEventLevel.Warning; TraceLevel expectedTraceLevel = TraceLevel.Warning; LogEvent logEvent = LogEventHelper.GetLogEvent(message, logEventLevel); ITextFormatter formatter = new MessageTemplateTextFormatter("{Message}", null); TraceEvent traceEvent = TraceWriterSink.BuildTraceEvent(logEvent, formatter); Assert.Equal(message, traceEvent.Message); Assert.Equal(expectedTraceLevel, traceEvent.Level); }