bd6c0b4d3d
Add missing <returns>/<param>/<summary>/<typeparam> tags and clean up misused inheritdoc across 481 files so the documented API surface is complete. Documentation-only (zero code lines changed). The 131 remaining findings are inheritdoc-style warnings deliberately left to preserve hand-written implementation rationale (plan-decision notes, race-condition explanations).
40 lines
1.3 KiB
C#
40 lines
1.3 KiB
C#
using CliFx.Infrastructure;
|
|
|
|
namespace ZB.MOM.WW.OtOpcUa.Client.CLI.Tests;
|
|
|
|
/// <summary>
|
|
/// Helper for creating CliFx <see cref="FakeInMemoryConsole" /> instances and reading their output.
|
|
/// </summary>
|
|
public static class TestConsoleHelper
|
|
{
|
|
/// <summary>
|
|
/// Creates a new <see cref="FakeInMemoryConsole" /> for testing.
|
|
/// </summary>
|
|
/// <returns>A new <see cref="FakeInMemoryConsole"/> instance.</returns>
|
|
public static FakeInMemoryConsole CreateConsole()
|
|
{
|
|
return new FakeInMemoryConsole();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Reads all text written to the console's standard output.
|
|
/// </summary>
|
|
/// <param name="console">The fake console instance.</param>
|
|
/// <returns>The console output text.</returns>
|
|
public static string GetOutput(FakeInMemoryConsole console)
|
|
{
|
|
console.Output.Flush();
|
|
return console.ReadOutputString();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Reads all text written to the console's standard error.
|
|
/// </summary>
|
|
/// <param name="console">The fake console instance.</param>
|
|
/// <returns>The console error text.</returns>
|
|
public static string GetError(FakeInMemoryConsole console)
|
|
{
|
|
console.Error.Flush();
|
|
return console.ReadErrorString();
|
|
}
|
|
} |