Esempio n. 1
0
 public void GenerateReport(IReportReceiver recv, AnalysisResults results)
 {
     var text = Resources.angular_report;
     var json = JsonConvert.SerializeObject(new Report(results));
     text = text.Replace("@@ANALYSIS_RESULTS@@", json);
     recv.GenerateReport(text);
 }
Esempio n. 2
0
 public void GenerateReport(IReportReceiver receiver, AnalysisResults results)
 {
     var writer = new StringWriter();
     var xml = GenerateXml(results);
     var xwriter = XmlWriter.Create(writer);
     xml.WriteTo(xwriter);
     xwriter.Flush();
     receiver.GenerateReport(writer.ToString());
 }
Esempio n. 3
0
        public void GenerateReport(IReportReceiver recv, AnalysisResults results)
        {
            var xmlReporter = new XUnitReporter();
            var xml = xmlReporter.GenerateXml(results);

            var transform = new XslCompiledTransform();
            transform.Load(new XmlTextReader(new StringReader(Properties.Resources.XUnitHtml_xslt)));

            var writer = new StringWriter();
            var xwriter = XmlWriter.Create(writer);
            transform.Transform(xml.CreateNavigator(), null, xwriter);
            xwriter.Flush();
            recv.GenerateReport(writer.ToString());
        }
Esempio n. 4
0
        public void GenerateReport(IReportReceiver recv, AnalysisResults results)
        {
            var writer = new StringWriter();
            writer.WriteLine("Analysis started at " + results.AnalysisTime);
            writer.WriteLine("Number of test cases analyzed = " + results.TestCaseCount);
            writer.WriteLine("Total analysis time (ms) = " + results.ElapsedTimeInMilliseconds);
            writer.WriteLine("Violations:");
            var score = 0m;
            foreach (var app in results.Applications)
            {
                score += app.Score;
                foreach (var violation in app.Violations)
                {
                    writer.WriteLine("  {0}", violation);
                }
            }

            writer.WriteLine();
            writer.WriteLine("Total score = " + score);
            recv.GenerateReport(writer.ToString());
        }