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:
@@ -2,28 +2,30 @@ using Opc.Ua;
|
||||
using ZB.MOM.WW.LmxOpcUa.Client.Shared;
|
||||
using ZB.MOM.WW.LmxOpcUa.Client.Shared.Models;
|
||||
using BrowseResult = ZB.MOM.WW.LmxOpcUa.Client.Shared.Models.BrowseResult;
|
||||
using ConnectionState = ZB.MOM.WW.LmxOpcUa.Client.Shared.Models.ConnectionState;
|
||||
|
||||
namespace ZB.MOM.WW.LmxOpcUa.Client.UI.Tests.Fakes;
|
||||
|
||||
/// <summary>
|
||||
/// Fake IOpcUaClientService for unit testing.
|
||||
/// Fake IOpcUaClientService for unit testing.
|
||||
/// </summary>
|
||||
public sealed class FakeOpcUaClientService : IOpcUaClientService
|
||||
{
|
||||
// Configurable responses
|
||||
public ConnectionInfo? ConnectResult { get; set; }
|
||||
public Exception? ConnectException { get; set; }
|
||||
public IReadOnlyList<BrowseResult> BrowseResults { get; set; } = Array.Empty<BrowseResult>();
|
||||
public IReadOnlyList<BrowseResult> BrowseResults { get; set; } = [];
|
||||
public Exception? BrowseException { get; set; }
|
||||
public DataValue ReadResult { get; set; } = new DataValue(new Variant(42), StatusCodes.Good, DateTime.UtcNow, DateTime.UtcNow);
|
||||
|
||||
public DataValue ReadResult { get; set; } =
|
||||
new(new Variant(42), StatusCodes.Good, DateTime.UtcNow, DateTime.UtcNow);
|
||||
|
||||
public Exception? ReadException { get; set; }
|
||||
public StatusCode WriteResult { get; set; } = StatusCodes.Good;
|
||||
public Exception? WriteException { get; set; }
|
||||
public RedundancyInfo? RedundancyResult { get; set; }
|
||||
public Exception? RedundancyException { get; set; }
|
||||
public IReadOnlyList<DataValue> HistoryRawResult { get; set; } = Array.Empty<DataValue>();
|
||||
public IReadOnlyList<DataValue> HistoryAggregateResult { get; set; } = Array.Empty<DataValue>();
|
||||
public IReadOnlyList<DataValue> HistoryRawResult { get; set; } = [];
|
||||
public IReadOnlyList<DataValue> HistoryAggregateResult { get; set; } = [];
|
||||
public Exception? HistoryException { get; set; }
|
||||
|
||||
// Call tracking
|
||||
@@ -134,14 +136,16 @@ public sealed class FakeOpcUaClientService : IOpcUaClientService
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public Task<IReadOnlyList<DataValue>> HistoryReadRawAsync(NodeId nodeId, DateTime startTime, DateTime endTime, int maxValues = 1000, CancellationToken ct = default)
|
||||
public Task<IReadOnlyList<DataValue>> HistoryReadRawAsync(NodeId nodeId, DateTime startTime, DateTime endTime,
|
||||
int maxValues = 1000, CancellationToken ct = default)
|
||||
{
|
||||
HistoryReadRawCallCount++;
|
||||
if (HistoryException != null) throw HistoryException;
|
||||
return Task.FromResult(HistoryRawResult);
|
||||
}
|
||||
|
||||
public Task<IReadOnlyList<DataValue>> HistoryReadAggregateAsync(NodeId nodeId, DateTime startTime, DateTime endTime, AggregateType aggregate, double intervalMs = 3600000, CancellationToken ct = default)
|
||||
public Task<IReadOnlyList<DataValue>> HistoryReadAggregateAsync(NodeId nodeId, DateTime startTime, DateTime endTime,
|
||||
AggregateType aggregate, double intervalMs = 3600000, CancellationToken ct = default)
|
||||
{
|
||||
HistoryReadAggregateCallCount++;
|
||||
LastAggregateType = aggregate;
|
||||
@@ -156,13 +160,24 @@ public sealed class FakeOpcUaClientService : IOpcUaClientService
|
||||
return Task.FromResult(RedundancyResult!);
|
||||
}
|
||||
|
||||
// Methods to raise events from tests
|
||||
public void RaiseDataChanged(DataChangedEventArgs args) => DataChanged?.Invoke(this, args);
|
||||
public void RaiseAlarmEvent(AlarmEventArgs args) => AlarmEvent?.Invoke(this, args);
|
||||
public void RaiseConnectionStateChanged(ConnectionStateChangedEventArgs args) => ConnectionStateChanged?.Invoke(this, args);
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// No-op for testing
|
||||
}
|
||||
}
|
||||
|
||||
// Methods to raise events from tests
|
||||
public void RaiseDataChanged(DataChangedEventArgs args)
|
||||
{
|
||||
DataChanged?.Invoke(this, args);
|
||||
}
|
||||
|
||||
public void RaiseAlarmEvent(AlarmEventArgs args)
|
||||
{
|
||||
AlarmEvent?.Invoke(this, args);
|
||||
}
|
||||
|
||||
public void RaiseConnectionStateChanged(ConnectionStateChangedEventArgs args)
|
||||
{
|
||||
ConnectionStateChanged?.Invoke(this, args);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user