Exemplo n.º 1
0
        private static void WriteXmlReport(TestReportCollection testReports, string xmlReportOutputPath, XmlReportType xmlReportType)
        {
            if (!string.IsNullOrEmpty(xmlReportOutputPath))
            {
                IXmlReport xmlReport = null;
                switch (xmlReportType)
                {
                case XmlReportType.TFS:
                    xmlReport = new Core.Reporting.Providers.TFS.TFS2010.XmlReport(testReports);
                    break;

                case XmlReportType.StatLight:
                    xmlReport = new XmlReport(testReports);
                    break;

                default:
                    throw new StatLightException("Unknown XmlReportType chosen Name=[{0}], Value=[{1}]".FormatWith(xmlReportType.ToString(), (int)xmlReportType));
                }

                xmlReport.WriteXmlReport(xmlReportOutputPath);

                "*********************************"
                .WrapConsoleMessageWithColor(Settings.Default.ConsoleColorInformatoin, true);

                "Wrote XML report to:{0}{1}"
                .FormatWith(Environment.NewLine, new FileInfo(xmlReportOutputPath).FullName)
                .WrapConsoleMessageWithColor(Settings.Default.ConsoleColorWarning, true);

                "*********************************"
                .WrapConsoleMessageWithColor(Settings.Default.ConsoleColorInformatoin, true);
            }
        }
Exemplo n.º 2
0
 public PdfReportGenerator(IXmlReport report)
 {
     this.report = report;
     xslt = new XslCompiledTransform();
     using (var stream = typeof(PdfReportGenerator).Assembly.GetManifestResourceStream(this.report.XmlStylesheetResourceName))
     {
         xslt.Load(new XmlTextReader(stream));
     }
 }
Exemplo n.º 3
0
 public PdfReportGenerator(IXmlReport report)
 {
     this.report = report;
     xslt        = new XslCompiledTransform();
     using (var stream = typeof(PdfReportGenerator).Assembly.GetManifestResourceStream(this.report.XmlStylesheetResourceName))
     {
         xslt.Load(new XmlTextReader(stream));
     }
 }