public bool WriteFile(IList <ResultFile> files, Stream stream) { ResultSummary summary = SummaryCalculator.Calculate(files); Stopwatch.Stop(); using (var writer = CreateDocument(stream)) { WriteBody(writer, summary, files); WriteResults(writer, files); WriteDefinitions(writer, files); WriteEntries(writer, files); WriteTestLists(writer); WriteSummaryAndEnd(writer, summary, files); } Console.WriteLine(); Console.WriteLine("Total tests: {0}. Passed: {1}. Failed: {2}. Skipped: {3}.", summary.Total, summary.Passed, summary.Failed, summary.Total - summary.Passed - summary.Failed); if (summary.Failed == 0) { Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine("Test Run Succeded."); Console.ResetColor(); } else { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("Test Run Failed."); Console.ResetColor(); } Console.WriteLine("Test execution time: {0}", GetReadableTimeSpan(Stopwatch.Elapsed())); return(summary.Failed == 0); }