public void Add(TestResultsInfo summand) { this.Total += summand.Total; this.Passed += summand.Passed; this.Failed += summand.Failed; this.Pending += summand.Pending; this.Issues += summand.Issues; this.BigIssues += summand.BigIssues; this.Error += summand.Error; }
public static TestResultsInfo CreateFromFile(string htmlFileName) { TestResultsInfo result = new TestResultsInfo(); // HtmlDocument htmlDocument = new HtmlDocument(); htmlDocument.Load(htmlFileName); // // HtmlNode nodeTotalsLeft = htmlDocument.DocumentNode.SelectSingleNode("//div[@class='totalsLeft']"); if (nodeTotalsLeft != null) { foreach(HtmlNode subNode in nodeTotalsLeft.ChildNodes) { if (subNode.GetAttributeValue("class", "") == "totalTotal") result.Total = getValueAfterColon(subNode.InnerText); if (subNode.GetAttributeValue("class", "") == "totalPassed") result.Passed = getValueAfterColon(subNode.InnerText); if (subNode.GetAttributeValue("class", "") == "totalFailed") result.Failed = getValueAfterColon(subNode.InnerText); if (subNode.GetAttributeValue("class", "") == "totalPending") result.Pending = getValueAfterColon(subNode.InnerText); // if (subNode.GetAttributeValue("class", "") == "totalIssues") { string innerText = subNode.InnerText; if (innerText.IndexOf('+') >= 0) { result.BigIssues = getValueAfterColon(innerText); result.Issues = getValueAfterPlus(innerText); } else { result.BigIssues = 0; result.Issues = getValueAfterColon(innerText); } } } } else { result.Error = 1; } // return result; }
public static TestResultsInfo CreateError() { TestResultsInfo result = new TestResultsInfo(); result.Error = 1; return result; }