Add cross-platform OPC UA client stack: shared library, CLI tool, and Avalonia UI
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>
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
using Opc.Ua;
|
||||
using ZB.MOM.WW.LmxOpcUa.Client.Shared.Adapters;
|
||||
|
||||
namespace ZB.MOM.WW.LmxOpcUa.Client.Shared.Tests.Fakes;
|
||||
|
||||
internal sealed class FakeEndpointDiscovery : IEndpointDiscovery
|
||||
{
|
||||
public bool ThrowOnSelect { get; set; }
|
||||
public int SelectCallCount { get; private set; }
|
||||
public string? LastEndpointUrl { get; private set; }
|
||||
|
||||
public EndpointDescription SelectEndpoint(ApplicationConfiguration config, string endpointUrl, MessageSecurityMode requestedMode)
|
||||
{
|
||||
SelectCallCount++;
|
||||
LastEndpointUrl = endpointUrl;
|
||||
|
||||
if (ThrowOnSelect)
|
||||
throw new InvalidOperationException($"No endpoint found for {endpointUrl}");
|
||||
|
||||
return new EndpointDescription
|
||||
{
|
||||
EndpointUrl = endpointUrl,
|
||||
SecurityMode = requestedMode,
|
||||
SecurityPolicyUri = requestedMode == MessageSecurityMode.None
|
||||
? SecurityPolicies.None
|
||||
: SecurityPolicies.Basic256Sha256,
|
||||
Server = new ApplicationDescription
|
||||
{
|
||||
ApplicationName = "FakeServer",
|
||||
ApplicationUri = "urn:localhost:FakeServer"
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user