/// <summary> /// Writes the runtime environment. /// </summary> /// <param name="writer">The writer.</param> public static void WriteRuntimeEnvironment(ExtendedTextWriter writer) { writer.WriteLine(ColorStyle.SectionHeader, "Runtime Environment -"); writer.WriteLabelLine(" OS Version: ", Environment.OSVersion); writer.WriteLabelLine(" CLR Version: ", Environment.Version); writer.WriteLine(); }
/// <summary> /// Prints the Summary Report /// </summary> public void WriteSummaryReport() { var status = _result.ResultState.Status; ColorStyle overallStyle = status == TestStatus.Passed ? ColorStyle.Pass : status == TestStatus.Failed ? ColorStyle.Failure : status == TestStatus.Skipped ? ColorStyle.Warning : ColorStyle.Output; _writer.WriteLine(ColorStyle.SectionHeader, "Test Run Summary"); _writer.WriteLabelLine(" Overall result: ", _overallResult, overallStyle); _writer.WriteLabel(" Tests run: ", Summary.RunCount.ToString(CultureInfo.CurrentUICulture)); _writer.WriteLabel(", Passed: ", Summary.PassCount.ToString(CultureInfo.CurrentUICulture)); _writer.WriteLabel(", Errors: ", Summary.ErrorCount.ToString(CultureInfo.CurrentUICulture)); _writer.WriteLabel(", Failures: ", Summary.FailureCount.ToString(CultureInfo.CurrentUICulture)); _writer.WriteLabelLine(", Inconclusive: ", Summary.InconclusiveCount.ToString(CultureInfo.CurrentUICulture)); var notRunTotal = Summary.SkipCount + Summary.IgnoreCount + Summary.InvalidCount; _writer.WriteLabel(" Not run: ", notRunTotal.ToString(CultureInfo.CurrentUICulture)); _writer.WriteLabel(", Invalid: ", Summary.InvalidCount.ToString(CultureInfo.CurrentUICulture)); _writer.WriteLabel(", Ignored: ", Summary.IgnoreCount.ToString(CultureInfo.CurrentUICulture)); _writer.WriteLabelLine(", Skipped: ", Summary.SkipCount.ToString(CultureInfo.CurrentUICulture)); _writer.WriteLabelLine(" Start time: ", _result.StartTime.ToString("u")); _writer.WriteLabelLine(" End time: ", _result.EndTime.ToString("u")); _writer.WriteLabelLine(" Duration: ", _result.Duration.TotalSeconds.ToString("0.000") + " seconds"); _writer.WriteLine(); }
/// <summary> /// Prints the Summary Report /// </summary> public void PrintSummaryReport() { var status = result.ResultState.Status; ColorStyle overall = status == TestStatus.Passed ? ColorStyle.Pass : status == TestStatus.Failed ? ColorStyle.Failure : ColorStyle.Warning; _writer.WriteLine(); _writer.WriteLine(ColorStyle.SectionHeader, "Test Run Result -"); _writer.WriteLabelLine(" Overall result: ", result.ResultState.Status, overall); _writer.WriteLabel(" Tests run: ", summary.TestCount.ToString(CultureInfo.CurrentUICulture)); _writer.WriteLabel(", Passed: ", summary.PassCount.ToString(CultureInfo.CurrentUICulture)); _writer.WriteLabel(", Errors: ", summary.ErrorCount.ToString(CultureInfo.CurrentUICulture)); _writer.WriteLabel(", Failures: ", summary.FailureCount.ToString(CultureInfo.CurrentUICulture)); _writer.WriteLabelLine(", Inconclusive: ", summary.InconclusiveCount.ToString(CultureInfo.CurrentUICulture)); _writer.WriteLabel(" Not run: ", summary.NotRunCount.ToString(CultureInfo.CurrentUICulture)); _writer.WriteLabel(", Invalid: ", summary.InvalidCount.ToString(CultureInfo.CurrentUICulture)); _writer.WriteLabel(", Ignored: ", summary.IgnoreCount.ToString(CultureInfo.CurrentUICulture)); _writer.WriteLabelLine(", Skipped: ", summary.SkipCount.ToString(CultureInfo.CurrentUICulture)); _writer.WriteLabelLine(" Start time: ", result.StartTime.ToString("u")); _writer.WriteLabelLine(" End time: ", result.EndTime.ToString("u")); _writer.WriteLabelLine(" Duration: ", result.Duration.TotalSeconds.ToString("0.000") + " seconds"); }
private void DisplayRequestedOptions(ExtendedTextWriter writer) { writer.WriteLine(ColorStyle.SectionHeader, "Options -"); if (_options.DefaultTimeout >= 0) { writer.WriteLabelLine(" Default timeout: ", _options.DefaultTimeout); } writer.WriteLabelLine(" Work Directory: ", _workDirectory); writer.WriteLabelLine(" Internal Trace: ", _options.InternalTraceLevel ?? "Off"); if (_options.TeamCity) { writer.WriteLine(ColorStyle.Value, " Display TeamCity Service Messages"); } writer.WriteLine(); if (_options.TestList.Count > 0) { writer.WriteLine(ColorStyle.SectionHeader, "Selected test(s) -"); foreach (string testName in _options.TestList) { writer.WriteLine(ColorStyle.Value, " " + testName); } writer.WriteLine(); } if (!string.IsNullOrEmpty(_options.Include)) { writer.WriteLabelLine("Included categories: ", _options.Include); writer.WriteLine(); } if (!string.IsNullOrEmpty(_options.Exclude)) { writer.WriteLabelLine("Excluded categories: ", _options.Exclude); writer.WriteLine(); } }
private void WriteLabelLine(string label, object option) { _outWriter.WriteLabelLine(label, option); }