public async Task ExceptionTypeIsPreserved() { var ex = await ObtainException(); var enricher = new DemystifiedStackTraceEnricher(); var le = new LogEvent(DateTimeOffset.UtcNow, LogEventLevel.Error, ex, MessageTemplate.Empty, Enumerable.Empty <LogEventProperty>()); enricher.Enrich(le, null); Assert.IsType <NotImplementedException>(le.Exception); }
public async Task StackTracesAreDemystified() { var ex = await ObtainException(); var enricher = new DemystifiedStackTraceEnricher(); var le = new LogEvent(DateTimeOffset.UtcNow, LogEventLevel.Error, ex, MessageTemplate.Empty, Enumerable.Empty <LogEventProperty>()); enricher.Enrich(le, null); var sts = le.Exception.StackTrace; Assert.Contains("async Task<Exception> Serilog.Enrichers.Demystify.Tests.DemystifiedStackTraceEnricherTests.ObtainException()", sts); }