示例#1
0
        public string GetResponse(WebService service)
        {
            StrategyComparisonResults comparisonResults = service.GetResultsFor(this);
            var HtmlReportGenerator = new HtmlReportGenerator(comparisonResults);

            return(HtmlReportGenerator.CreateHtmlReport());
        }
示例#2
0
        public void CreateHtmlReport_ShouldContainTargetMachineNameInHeader()
        {
            HtmlReportGenerator target = new HtmlReportGenerator(_events, new FilterConfiguration("", new TimeSpan(), 10, "testRemoteMachineName", null), _emailConfig);

            string result = target.CreateHtmlReport();

            Assert.That(result, Does.Contain("testRemoteMachineName"));
        }
示例#3
0
        public void CreateHtmlReport_ShouldGiveSpecificLogNameInHeader()
        {
            HtmlReportGenerator target = new HtmlReportGenerator(_events, new FilterConfiguration("", new TimeSpan(), 10, null, "Security"), _emailConfig);

            string result = target.CreateHtmlReport();

            Assert.That(result, Does.Contain("Security"));
        }
示例#4
0
        public void CreateHtmlReport_ShouldGiveDefaultLogNameInHeader()
        {
            HtmlReportGenerator target = new HtmlReportGenerator(_events, _filterConfig, _emailConfig); //Uses default log

            string result = target.CreateHtmlReport();

            Assert.That(result, Does.Contain("Application")); //Application is the default log
        }
示例#5
0
        public void ShouldNotCrashIfNullPassedAsEvents()
        {
            var target = new HtmlReportGenerator(null, _filterConfig, _emailConfig);

            var result = target.CreateHtmlReport();

            Assert.That(result, Does.Contain("0 previously unreported events"));
        }
示例#6
0
        public void ShouldTellTheFilterString()
        {
            HtmlReportGenerator target = new HtmlReportGenerator(_events, _filterConfig, _emailConfig);

            string result = target.CreateHtmlReport();

            Assert.That(result, Does.Contain("testFilterString"));
        }
示例#7
0
        public void CreateHtmlReport_ShouldContainLocalMachineInHeaderIfEmptyRemoteMachine()
        {
            HtmlReportGenerator target = new HtmlReportGenerator(_events, new FilterConfiguration("", new TimeSpan(), 10, "", null), _emailConfig);

            string result = target.CreateHtmlReport();

            Assert.That(result, Does.Contain(Environment.MachineName));
        }
示例#8
0
        public void ShouldIndicateMaxMessagesReached()
        {
            var target =
                new HtmlReportGenerator(
                    Enumerable.Range(0, _filterConfig.MaxMessages).Select(i => new LogEvent()), _filterConfig, _emailConfig);

            var result = target.CreateHtmlReport();

            Assert.That(result, Does.Contain(_filterConfig.MaxMessages + " latest previously unreported events"));
        }
示例#9
0
        public void ShouldHaveHeader()
        {
            HtmlReportGenerator target = new HtmlReportGenerator(_events, _filterConfig, _emailConfig);

            string result = target.CreateHtmlReport();

            Assert.That(result, Does.Contain("events from the Application log from"));
            Assert.That(result, Does.Contain(DateTime.Now.Date.ToShortDateString()));
            Assert.That(result, Does.Contain(DateTime.Now.AddDays(-1).Date.ToShortDateString()));
        }
示例#10
0
        public void CreateHtmlReport_ShouldReturnItemsInTable()
        {
            HtmlReportGenerator target = new HtmlReportGenerator(_events, _filterConfig, _emailConfig);

            string result = target.CreateHtmlReport();

            Assert.That(result, Does.Contain("inside"));
            Assert.That(result, Does.Contain("inside2"));
            Assert.That(result, Does.Contain("<table"));
            Assert.That(result, Does.Contain("</table>"));
        }