feat(cli): add enable/disable condition commands (H4 client path)

This commit is contained in:
Joseph Doherty
2026-06-19 01:48:21 -04:00
parent eb328e5761
commit 88d5ba45bf
10 changed files with 488 additions and 0 deletions
@@ -301,6 +301,42 @@ public sealed class FakeOpcUaClientService : IOpcUaClientService
return Task.FromResult(ShelveResult);
}
/// <summary>Gets or sets the status code returned by enable operations in UI tests.</summary>
public StatusCode EnableResult { get; set; } = StatusCodes.Good;
/// <summary>Gets or sets the exception thrown to simulate alarm enable failures in the UI.</summary>
public Exception? EnableException { get; set; }
/// <summary>Gets the number of times EnableAsync has been called.</summary>
public int EnableCallCount { get; private set; }
/// <summary>Gets the conditionNodeId of the last EnableAsync call.</summary>
public string? LastEnableCall { get; private set; }
/// <inheritdoc />
public Task<StatusCode> EnableAsync(string conditionNodeId, CancellationToken ct = default)
{
EnableCallCount++;
LastEnableCall = conditionNodeId;
if (EnableException != null) throw EnableException;
return Task.FromResult(EnableResult);
}
/// <summary>Gets or sets the status code returned by disable operations in UI tests.</summary>
public StatusCode DisableResult { get; set; } = StatusCodes.Good;
/// <summary>Gets or sets the exception thrown to simulate alarm disable failures in the UI.</summary>
public Exception? DisableException { get; set; }
/// <summary>Gets the number of times DisableAsync has been called.</summary>
public int DisableCallCount { get; private set; }
/// <summary>Gets the conditionNodeId of the last DisableAsync call.</summary>
public string? LastDisableCall { get; private set; }
/// <inheritdoc />
public Task<StatusCode> DisableAsync(string conditionNodeId, CancellationToken ct = default)
{
DisableCallCount++;
LastDisableCall = conditionNodeId;
if (DisableException != null) throw DisableException;
return Task.FromResult(DisableResult);
}
/// <inheritdoc />
public Task<IReadOnlyList<DataValue>> HistoryReadRawAsync(NodeId nodeId, DateTime startTime, DateTime endTime,
int maxValues = 1000, CancellationToken ct = default)