public void Trace_CallsInnerWriterTrace() { var traceWriter = new TestTraceWriter(TraceLevel.Verbose); var compositeWriter = new CompositeTraceWriter(new[] { traceWriter }); string message = "Test trace"; compositeWriter.Verbose(message); TraceEvent trace = traceWriter.Traces.FirstOrDefault(); Assert.NotNull(trace); Assert.Equal(TraceLevel.Verbose, trace.Level); Assert.Equal(message, trace.Message); }
public void Trace_RespectsInnerWriterLevel() { var traceWriter = new TestTraceWriter(TraceLevel.Error); var compositeWriter = new CompositeTraceWriter(new[] { traceWriter }); string message = "Test trace"; compositeWriter.Verbose(message); compositeWriter.Error(message); Assert.Equal(1, traceWriter.Traces.Count); TraceEvent trace = traceWriter.Traces.First(); Assert.Equal(TraceLevel.Error, trace.Level); Assert.Equal(message, trace.Message); }