public void TagsAreReportedInHtmlReport() { var model = new HtmlReportModel(this.CreateReportModel()) { RunDate = new DateTime(2014, 3, 25, 11, 30, 5) }; var sut = new ClassicReportBuilder(); ReportApprover.Approve(model, sut); }
public void TagsAreReportedInMetroHtmlReport() { var reportModel = this.CreateReportModel(); var model = new HtmlReportModel(reportModel) { RunDate = new DateTime(2014, 3, 25, 11, 30, 5) }; var sut = new MetroReportBuilder(); ReportApprover.Approve(model, sut); }
public void ShouldProduceExpectedHtml() { var model = new HtmlReportModel(new ReportTestData().CreateMixContainingEachTypeOfOutcome().ToReportModel()) { RunDate = new DateTime(2014, 3, 25, 11, 30, 5) }; var sut = new MetroReportBuilder(); ReportApprover.Approve(model, sut); }
public void ShouldProduceExpectedHtmlWithExamples() { var reportData = new ReportTestData().CreateTwoStoriesEachWithOneFailingScenarioAndOnePassingScenarioWithThreeStepsOfFiveMillisecondsAndEachHasTwoExamples().ToReportModel(); var model = new HtmlReportModel(reportData) { RunDate = new DateTime(2014, 3, 25, 11, 30, 5) }; var sut = new ClassicReportBuilder(); ReportApprover.Approve(model, sut); }
private static void WriteHtmlReport( [NotNull] QualitySpecification qualitySpecification, [NotNull] string directory, [NotNull] HtmlReportDefinition reportDefinition, [NotNull] IssueStatistics issueStatistics, [NotNull] XmlVerificationReport verificationReport, [NotNull] string verificationReportFileName, [CanBeNull] string issueGdbPath, [CanBeNull] IEnumerable <string> issueMapFilePaths, [NotNull] IEnumerable <string> htmlReportFileNames, [CanBeNull] IEnumerable <string> qualitySpecificationReportFilePaths) { Assert.ArgumentNotNull(reportDefinition, nameof(reportDefinition)); Assert.ArgumentCondition(File.Exists(reportDefinition.TemplatePath), "Template file does not exist: {0}", reportDefinition.TemplatePath); string reportFilePath = Path.Combine(directory, reportDefinition.FileName); _msg.DebugFormat("Preparing html report model"); var reportModel = new HtmlReportModel(qualitySpecification, issueStatistics, verificationReport, directory, verificationReportFileName, issueGdbPath, issueMapFilePaths, htmlReportFileNames, qualitySpecificationReportFilePaths, reportDefinition); _msg.DebugFormat("Rendering html report based on template {0}", reportDefinition.TemplatePath); LiquidUtils.RegisterSafeType <HtmlReportModel>(); LiquidUtils.RegisterSafeType <HtmlTexts>(); string output = LiquidUtils.Render( reportDefinition.TemplatePath, new KeyValuePair <string, object>("report", reportModel), new KeyValuePair <string, object>("text", new HtmlTexts())); _msg.DebugFormat("Writing html report to {0}", reportFilePath); FileSystemUtils.WriteTextFile(output, reportFilePath); _msg.InfoFormat("Html report written to {0}", reportFilePath); }