public void Write(SuiteResult testResults) { string resultString = "passed successfully"; if (testResults.Success == false) resultString = "failed"; Console.WriteLine(string.Format("Tests {0}.", resultString)); string statistics = "Success {0}, Ignored {1}, Failed {2}"; Console.WriteLine(string.Format(statistics, testResults.SuccessCount, testResults.IgnoredCount, testResults.FailedCount)); }
/// <summary> /// Collects and summarised data /// </summary> /// <param name="classResultList"></param> /// <returns></returns> public SuiteResult MakeSummary(List<ClassResult> classResultList) { var summary = new SuiteResult(); foreach (ClassResult classResult in classResultList) { if (classResult == null) continue; foreach (MethodResult methodResult in classResult.MethodResults) { if (methodResult.Ignored) classResult.IgnoredCount++; else if (methodResult.Success == false) classResult.FailedCount++; else classResult.SuccessCount++; } if (classResult.FailedCount == 0) // ignored cases isn't equal to failed ones summary.SuccessfullTests.Add(classResult); else summary.FailedTests.Add(classResult); summary.FailedCount += classResult.FailedCount; summary.IgnoredCount += classResult.IgnoredCount; summary.SuccessCount += classResult.SuccessCount; } return summary; }
public void Write(SuiteResult result) { }