64e3fbe035
v2-ci / build (push) Failing after 1m43s
v2-ci / unit-tests (tests/Core/ZB.MOM.WW.OtOpcUa.Cluster.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.ControlPlane.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.Security.Tests) (push) Has been skipped
v2-ci / integration (tests/Server/ZB.MOM.WW.OtOpcUa.Host.IntegrationTests) (push) Has been skipped
v2-ci / integration (tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.IntegrationTests) (push) Has been skipped
Adds <summary>, <param>, <typeparam>, and <inheritdoc/> tags to public members surfaced by commentchecker — resolves 5,847 of 5,869 issues (99.6%) across three /fixdocs passes.
39 lines
1.2 KiB
C#
39 lines
1.2 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>
|
|
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();
|
|
}
|
|
} |