Ejemplo n.º 1
0
        private void ShouldTheReportUseCustomization(HtmlReportViewModel viewModel)
        {
            var customStylesheet = Path.Combine(_configuration.OutputPath, "BDDfyCustom.css");
            viewModel.UseCustomStylesheet = File.Exists(customStylesheet);

            var customJavascript = Path.Combine(_configuration.OutputPath, "BDDfyCustom.js");
            viewModel.UseCustomJavascript = File.Exists(customJavascript);
        }
        public string CreateReport(HtmlReportViewModel model)
        {
            _viewModel = model;
            AddLine("<!DOCTYPE html>");
            using(OpenTag(HtmlTag.html))
            {
                HtmlHead();
                HtmlBody();
            }

            return _html.ToString();
        }
Ejemplo n.º 3
0
        void WriteOutHtmlReport(IEnumerable<Story> stories)
        {
            const string error = "There was an error compiling the html report: ";
            var viewModel = new HtmlReportViewModel(_configuration, stories);
            ShouldTheReportUseCustomization(viewModel);
            string report;

            try
            {
                report = _builder.CreateReport(viewModel);
            }
            catch (Exception ex)
            {
                report = error + ex.Message;
            }

            _writer.OutputReport(report, _configuration.OutputFileName, _configuration.OutputPath);
        }