public void ShouldSetEventLogNameCorrectlyToContext(string configured, string expected) { SetupFilterConfig(eventLogName: configured); var context = HtmlReportGenerator.CreateContextHash(_filterConfig, new LogEventDrop[] { }); Assert.That(context["event_log_name"], Is.EqualTo(expected)); }
public void ShouldSetMachineNameCorrectlyToContext(string configured, string expected) { SetupFilterConfig(remoteMachineName: configured); var context = HtmlReportGenerator.CreateContextHash(_filterConfig, new LogEventDrop[] {}); Assert.That(context["machine_name"], Is.EqualTo(expected ?? Environment.MachineName)); }
public void ShouldUseShortDateStringsForContext() { DateTime expectedDateTime = DateTime.Now; var context = HtmlReportGenerator.CreateContextHash(_filterConfig, new LogEventDrop[] {}); Assert.That(context["start_time"], Does.Contain(expectedDateTime.AddDays(-1).ToString("g")), "The header should contain the end time (the current time) in short date time format"); Assert.That(context["current_time"], Does.Contain(expectedDateTime.ToString("g")), "The header should contain the end time (the current time) in short date time format"); }