示例#1
0
        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));
        }
示例#2
0
        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));
        }
示例#3
0
        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");
        }