public static void PrintEnd(PlatformResults results) { var file = results.File; if (TeamCity) { Console.WriteLine("##teamcity[testSuiteStarted name='{0}']", "all"); } else { Console.WriteLine(); PrintCount(results.Errors, "Errors:"); PrintCount(results.Failures, "Failures:"); PrintCount(results.Ignores, "Ignores:"); PrintCount(results.NoErrors, "NoErrors:"); PrintTotaledCount(results, results.Success, "Success:"); Console.WriteLine("Final Total"); Console.WriteLine(); var resultCount = file.ResultCount; foreach (var kp in resultCount.OrderBy(it => it.Key)) { Console.WriteLine(" {0,-15}{1,4}", kp.Key, kp.Value); } Console.WriteLine("{0,-17}{1,4}", "Total", resultCount.Select(r => r.Value).Sum()); } }
public static void PrintTotaledCount(PlatformResults fullResults, IEnumerable <Result> results, string header) { lock (fullResults.ExpectedTests) { Console.WriteLine(header); var totalCount = fullResults.ExpectedTests.SelectMany(it => it.Value) .Select(it => it.Result) .ToLookup(it => it.Platform) .ToDictionary(k => k.Key, v => v.Count()); foreach (var result in results.GroupBy(it => it.Platform)) { Console.Write(" {0,-15}{1,6}/{2}", result.Key, result.Count(), totalCount.ContainsKey(result.Key) ? totalCount[result.Key] : 0 ); Console.WriteLine(); } Console.WriteLine(); } }
public static void PrintTotaledCount(PlatformResults fullResults, IEnumerable<Result> results, string header) { lock (fullResults.ExpectedTests) { Console.WriteLine(header); var totalCount = fullResults.ExpectedTests.SelectMany(it => it.Value) .Select(it => it.Result) .ToLookup(it => it.Platform) .ToDictionary(k => k.Key, v => v.Count()); foreach (var result in results.GroupBy(it => it.Platform)) { Console.Write(" {0,-15}{1,6}/{2}" , result.Key, result.Count(), totalCount.ContainsKey(result.Key) ? totalCount[result.Key] : 0 ); Console.WriteLine(); } Console.WriteLine(); } }