Implements Client.Shared (IOpcUaClientService with connection lifecycle, failover, browse, read/write, subscriptions, alarms, history, redundancy), Client.CLI (8 CliFx commands mirroring tools/opcuacli-dotnet), and Client.UI (Avalonia desktop app with tree browser, read/write, subscriptions, alarms, and history tabs). All three target .NET 10 and are covered by 249 unit tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
36 lines
966 B
C#
36 lines
966 B
C#
using CliFx.Infrastructure;
|
|
|
|
namespace ZB.MOM.WW.LmxOpcUa.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>
|
|
public static string GetOutput(FakeInMemoryConsole console)
|
|
{
|
|
console.Output.Flush();
|
|
return console.ReadOutputString();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Reads all text written to the console's standard error.
|
|
/// </summary>
|
|
public static string GetError(FakeInMemoryConsole console)
|
|
{
|
|
console.Error.Flush();
|
|
return console.ReadErrorString();
|
|
}
|
|
}
|