/// <summary> /// Summarises the test results by grouping by assembly and then by class. /// </summary> void SummariseByClass() { SummaryByClass = new TestResultSummary(); var sbaRows = ResultLines.GroupBy(r => new { r.AssemblyPathName, r.ClassName }) .Select(gr => new { AssemblyPathName = gr.Key.AssemblyPathName, FullClassName = gr.Key.ClassName, TestResults = gr }); foreach (var sbaRow in sbaRows) { var summary = new TestResultSummaryLine(); summary.AssemblyPathName = sbaRow.AssemblyPathName; summary.FullClassName = sbaRow.FullClassName; foreach (var ocn in OutcomeNames) { var oc = new ResultOutcomeSummary() { Outcome = ocn }; oc.NumTests = (from r in sbaRow.TestResults where r.Outcome == ocn select r).Count(); oc.TotalDurationInSeconds = (from r in sbaRow.TestResults where r.Outcome == ocn select r).Sum(r => r.DurationInSeconds); summary.Outcomes.Add(oc); } SummaryByClass.Add(summary); } }
public void Add(TestResultSummaryLine summaryLine) { summaryLine.ThrowIfNull("summaryLine"); summaryLines.Add(summaryLine); }