コード例 #1
0
        public DotCoverReport ParseDotCoverReport()
        {
            _xDoc = XDocument.Load(_xmlStream);

            if (_xDoc.Root.Name.LocalName != "Root")
            {
                throw new ArgumentException(
                          "The DotCover report is expected to have a root element with name \"Root\".");
            }

            _root = _xDoc.Root;

            var report = new DotCoverReport();

            report.CoveragePercent   = _root.GetAttributeDecimalValue("CoveragePercent");
            report.CoveredStatements = _root.GetAttributeIntValue("CoveredStatements");
            report.DotCoverVersion   = _root.GetAttributeStringValue("DotCoverVersion");
            report.ReportType        = _root.GetAttributeStringValue("ReportType");
            report.TotalStatements   = _root.GetAttributeIntValue("TotalStatements");

            report.Assemblies = GetAssemblies();
            report.Files      = GetFileIndices();

            return(report);
        }
コード例 #2
0
 public DotCoverToCoberturaConverter(DotCoverReport report)
 {
     _report = report ?? throw new ArgumentNullException(nameof(report));
 }