public void LocalTimeTest() { var dt = new LongDateLayoutRenderer(); dt.UniversalTime = false; var ei = new LogEventInfo(LogLevel.Info, "logger", "msg"); Assert.Equal(ei.TimeStamp.ToString("yyyy-MM-dd HH:mm:ss.ffff", CultureInfo.InvariantCulture), dt.Render(ei)); }
public void UniversalTimeTest() { var dt = new LongDateLayoutRenderer(); dt.UniversalTime = true; var ei = new LogEventInfo(LogLevel.Info, "logger", "msg"); Assert.AreEqual(ei.TimeStamp.ToUniversalTime().ToString("yyyy-MM-dd HH:mm:ss.ffff"), dt.Render(ei)); }