public string GetResponse(WebService service) { StrategyComparisonResults comparisonResults = service.GetResultsFor(this); var HtmlReportGenerator = new HtmlReportGenerator(comparisonResults); return(HtmlReportGenerator.CreateHtmlReport()); }
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")); }
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")); }
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 }
public void ShouldNotCrashIfNullPassedAsEvents() { var target = new HtmlReportGenerator(null, _filterConfig, _emailConfig); var result = target.CreateHtmlReport(); Assert.That(result, Does.Contain("0 previously unreported events")); }
public void ShouldTellTheFilterString() { HtmlReportGenerator target = new HtmlReportGenerator(_events, _filterConfig, _emailConfig); string result = target.CreateHtmlReport(); Assert.That(result, Does.Contain("testFilterString")); }
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)); }
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")); }
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())); }
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>")); }