Apply code style formatting and restore partial modifiers on Avalonia views

Linter/formatter pass across the full codebase. Restores required partial
keyword on AXAML code-behind classes that the formatter incorrectly removed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Joseph Doherty
2026-03-31 07:58:13 -04:00
parent 55ef854612
commit 41a6b66943
221 changed files with 4274 additions and 3823 deletions

View File

@@ -6,8 +6,8 @@ using BrowseResult = ZB.MOM.WW.LmxOpcUa.Client.Shared.Models.BrowseResult;
namespace ZB.MOM.WW.LmxOpcUa.Client.CLI.Tests.Fakes;
/// <summary>
/// Fake implementation of <see cref="IOpcUaClientService"/> for unit testing commands.
/// Records all method calls and returns configurable results.
/// Fake implementation of <see cref="IOpcUaClientService" /> for unit testing commands.
/// Records all method calls and returns configurable results.
/// </summary>
public sealed class FakeOpcUaClientService : IOpcUaClientService
{
@@ -16,20 +16,24 @@ public sealed class FakeOpcUaClientService : IOpcUaClientService
public ConnectionSettings? LastConnectionSettings { get; private set; }
public bool DisconnectCalled { get; private set; }
public bool DisposeCalled { get; private set; }
public List<NodeId> ReadNodeIds { get; } = new();
public List<(NodeId NodeId, object Value)> WriteValues { get; } = new();
public List<NodeId?> BrowseNodeIds { get; } = new();
public List<(NodeId NodeId, int IntervalMs)> SubscribeCalls { get; } = new();
public List<NodeId> UnsubscribeCalls { get; } = new();
public List<(NodeId? SourceNodeId, int IntervalMs)> SubscribeAlarmsCalls { get; } = new();
public List<NodeId> ReadNodeIds { get; } = [];
public List<(NodeId NodeId, object Value)> WriteValues { get; } = [];
public List<NodeId?> BrowseNodeIds { get; } = [];
public List<(NodeId NodeId, int IntervalMs)> SubscribeCalls { get; } = [];
public List<NodeId> UnsubscribeCalls { get; } = [];
public List<(NodeId? SourceNodeId, int IntervalMs)> SubscribeAlarmsCalls { get; } = [];
public bool UnsubscribeAlarmsCalled { get; private set; }
public bool RequestConditionRefreshCalled { get; private set; }
public List<(NodeId NodeId, DateTime Start, DateTime End, int MaxValues)> HistoryReadRawCalls { get; } = new();
public List<(NodeId NodeId, DateTime Start, DateTime End, AggregateType Aggregate, double IntervalMs)> HistoryReadAggregateCalls { get; } = new();
public List<(NodeId NodeId, DateTime Start, DateTime End, int MaxValues)> HistoryReadRawCalls { get; } = [];
public List<(NodeId NodeId, DateTime Start, DateTime End, AggregateType Aggregate, double IntervalMs)>
HistoryReadAggregateCalls { get; } =
[];
public bool GetRedundancyInfoCalled { get; private set; }
// Configurable results
public ConnectionInfo ConnectionInfoResult { get; set; } = new ConnectionInfo(
public ConnectionInfo ConnectionInfoResult { get; set; } = new(
"opc.tcp://localhost:4840",
"TestServer",
"None",
@@ -37,7 +41,7 @@ public sealed class FakeOpcUaClientService : IOpcUaClientService
"session-1",
"TestSession");
public DataValue ReadValueResult { get; set; } = new DataValue(
public DataValue ReadValueResult { get; set; } = new(
new Variant(42),
StatusCodes.Good,
DateTime.UtcNow,
@@ -47,18 +51,18 @@ public sealed class FakeOpcUaClientService : IOpcUaClientService
public IReadOnlyList<BrowseResult> BrowseResults { get; set; } = new List<BrowseResult>
{
new BrowseResult("ns=2;s=Node1", "Node1", "Object", true),
new BrowseResult("ns=2;s=Node2", "Node2", "Variable", false)
new("ns=2;s=Node1", "Node1", "Object", true),
new("ns=2;s=Node2", "Node2", "Variable", false)
};
public IReadOnlyList<DataValue> HistoryReadResult { get; set; } = new List<DataValue>
{
new DataValue(new Variant(10.0), StatusCodes.Good, DateTime.UtcNow.AddHours(-1), DateTime.UtcNow),
new DataValue(new Variant(20.0), StatusCodes.Good, DateTime.UtcNow, DateTime.UtcNow)
new(new Variant(10.0), StatusCodes.Good, DateTime.UtcNow.AddHours(-1), DateTime.UtcNow),
new(new Variant(20.0), StatusCodes.Good, DateTime.UtcNow, DateTime.UtcNow)
};
public RedundancyInfo RedundancyInfoResult { get; set; } = new RedundancyInfo(
"Warm", 200, new[] { "urn:server1", "urn:server2" }, "urn:app:test");
public RedundancyInfo RedundancyInfoResult { get; set; } = new(
"Warm", 200, ["urn:server1", "urn:server2"], "urn:app:test");
public Exception? ConnectException { get; set; }
public Exception? ReadException { get; set; }
@@ -159,6 +163,11 @@ public sealed class FakeOpcUaClientService : IOpcUaClientService
return Task.FromResult(RedundancyInfoResult);
}
public void Dispose()
{
DisposeCalled = true;
}
/// <summary>Raises the DataChanged event for testing subscribe commands.</summary>
public void RaiseDataChanged(string nodeId, DataValue value)
{
@@ -176,9 +185,4 @@ public sealed class FakeOpcUaClientService : IOpcUaClientService
{
ConnectionStateChanged?.Invoke(this, new ConnectionStateChangedEventArgs(oldState, newState, endpointUrl));
}
public void Dispose()
{
DisposeCalled = true;
}
}
}