diff --git a/clients/dotnet/ZB.MOM.WW.MxGateway.Client.Tests/FakeGalaxyRepositoryTransport.cs b/clients/dotnet/ZB.MOM.WW.MxGateway.Client.Tests/FakeGalaxyRepositoryTransport.cs index ce42fc3..ac12537 100644 --- a/clients/dotnet/ZB.MOM.WW.MxGateway.Client.Tests/FakeGalaxyRepositoryTransport.cs +++ b/clients/dotnet/ZB.MOM.WW.MxGateway.Client.Tests/FakeGalaxyRepositoryTransport.cs @@ -48,6 +48,7 @@ internal sealed class FakeGalaxyRepositoryTransport(MxGatewayClientOptions optio /// public DiscoverHierarchyReply DiscoverHierarchyReply { get; set; } = new(); + /// Gets the queue of discover hierarchy replies; dequeued in FIFO order. public Queue DiscoverHierarchyReplies { get; } = new(); /// diff --git a/clients/dotnet/ZB.MOM.WW.MxGateway.Client.Tests/FakeGatewayTransport.cs b/clients/dotnet/ZB.MOM.WW.MxGateway.Client.Tests/FakeGatewayTransport.cs index d625650..7e81274 100644 --- a/clients/dotnet/ZB.MOM.WW.MxGateway.Client.Tests/FakeGatewayTransport.cs +++ b/clients/dotnet/ZB.MOM.WW.MxGateway.Client.Tests/FakeGatewayTransport.cs @@ -196,6 +196,8 @@ internal sealed class FakeGatewayTransport(MxGatewayClientOptions options) : IMx /// /// Records the acknowledge call and returns the next enqueued reply (or default). /// + /// The acknowledge alarm request. + /// Call options specifying RPC behavior. public Task AcknowledgeAlarmAsync( AcknowledgeAlarmRequest request, CallOptions callOptions) @@ -219,6 +221,8 @@ internal sealed class FakeGatewayTransport(MxGatewayClientOptions options) : IMx /// /// Records the query call and yields each enqueued snapshot. /// + /// The query active alarms request. + /// Call options specifying RPC behavior. public async IAsyncEnumerable QueryActiveAlarmsAsync( QueryActiveAlarmsRequest request, CallOptions callOptions) @@ -234,12 +238,14 @@ internal sealed class FakeGatewayTransport(MxGatewayClientOptions options) : IMx } /// Enqueues an acknowledge reply. + /// The acknowledge reply to enqueue. public void AddAcknowledgeReply(AcknowledgeAlarmReply reply) { _acknowledgeReplies.Enqueue(reply); } /// Enqueues a snapshot to be yielded from QueryActiveAlarmsAsync. + /// The snapshot to enqueue. public void AddActiveAlarmSnapshot(ActiveAlarmSnapshot snapshot) { _activeAlarmSnapshots.Add(snapshot); @@ -248,6 +254,8 @@ internal sealed class FakeGatewayTransport(MxGatewayClientOptions options) : IMx /// /// Records the stream-alarms call and yields each enqueued feed message. /// + /// The stream alarms request. + /// Call options specifying RPC behavior. public async IAsyncEnumerable StreamAlarmsAsync( StreamAlarmsRequest request, CallOptions callOptions) @@ -263,6 +271,7 @@ internal sealed class FakeGatewayTransport(MxGatewayClientOptions options) : IMx } /// Enqueues an alarm feed message to be yielded from StreamAlarmsAsync. + /// The alarm feed message to enqueue. public void AddAlarmFeedMessage(AlarmFeedMessage message) { _alarmFeedMessages.Add(message); diff --git a/clients/dotnet/ZB.MOM.WW.MxGateway.Client.Tests/GalaxyRepositoryClientTests.cs b/clients/dotnet/ZB.MOM.WW.MxGateway.Client.Tests/GalaxyRepositoryClientTests.cs index cc0c0ca..351a9d2 100644 --- a/clients/dotnet/ZB.MOM.WW.MxGateway.Client.Tests/GalaxyRepositoryClientTests.cs +++ b/clients/dotnet/ZB.MOM.WW.MxGateway.Client.Tests/GalaxyRepositoryClientTests.cs @@ -181,6 +181,9 @@ public sealed class GalaxyRepositoryClientTests Assert.Contains("repeated page token", exception.Message, StringComparison.Ordinal); } + /// + /// Verifies that DiscoverHierarchyAsync maps typed filter options correctly to the request. + /// [Fact] public async Task DiscoverHierarchyAsync_WithOptions_MapsTypedFilters() { @@ -212,6 +215,9 @@ public sealed class GalaxyRepositoryClientTests Assert.True(request.HistorizedOnly); } + /// + /// Verifies that TestConnectionAsync retries on transient gRPC failures. + /// [Fact] public async Task TestConnectionAsync_RetriesOnTransientGrpcFailure() { diff --git a/clients/dotnet/ZB.MOM.WW.MxGateway.Client.Tests/MxGatewayClientAlarmsTests.cs b/clients/dotnet/ZB.MOM.WW.MxGateway.Client.Tests/MxGatewayClientAlarmsTests.cs index c0cddc3..b178944 100644 --- a/clients/dotnet/ZB.MOM.WW.MxGateway.Client.Tests/MxGatewayClientAlarmsTests.cs +++ b/clients/dotnet/ZB.MOM.WW.MxGateway.Client.Tests/MxGatewayClientAlarmsTests.cs @@ -11,6 +11,7 @@ namespace ZB.MOM.WW.MxGateway.Client.Tests; /// public sealed class MxGatewayClientAlarmsTests { + /// AcknowledgeAlarmAsync records request and returns reply. [Fact] public async Task AcknowledgeAlarmAsync_RecordsRequestShapeAndReturnsReply() { @@ -46,6 +47,7 @@ public sealed class MxGatewayClientAlarmsTests Assert.Equal("Bearer test-api-key", call.CallOptions.Headers?.GetValue("authorization")); } + /// AcknowledgeAlarmAsync honors cancellation. [Fact] public async Task AcknowledgeAlarmAsync_HonorsCancellation() { @@ -69,6 +71,7 @@ public sealed class MxGatewayClientAlarmsTests cancellation.Token)); } + /// AcknowledgeAlarmAsync maps unauthenticated RPC exception to typed exception. [Fact] public async Task AcknowledgeAlarmAsync_MapsUnauthenticated_RpcException_ToTypedException() { @@ -93,6 +96,7 @@ public sealed class MxGatewayClientAlarmsTests Assert.Equal(StatusCode.Unauthenticated, ex.StatusCode); } + /// QueryActiveAlarmsAsync streams enqueued snapshots. [Fact] public async Task QueryActiveAlarmsAsync_StreamsEnqueuedSnapshots() { @@ -117,6 +121,7 @@ public sealed class MxGatewayClientAlarmsTests Assert.Single(transport.QueryActiveAlarmsCalls); } + /// QueryActiveAlarmsAsync passes filter prefix. [Fact] public async Task QueryActiveAlarmsAsync_PassesFilterPrefix() { @@ -136,6 +141,7 @@ public sealed class MxGatewayClientAlarmsTests Assert.Equal("Tank01.", call.Request.AlarmFilterPrefix); } + /// QueryActiveAlarmsAsync honors cancellation during enumeration. [Fact] public async Task QueryActiveAlarmsAsync_HonorsCancellationDuringEnumeration() { diff --git a/clients/dotnet/ZB.MOM.WW.MxGateway.Client.Tests/MxGatewayClientCliTests.cs b/clients/dotnet/ZB.MOM.WW.MxGateway.Client.Tests/MxGatewayClientCliTests.cs index 4cf8e46..a63ec30 100644 --- a/clients/dotnet/ZB.MOM.WW.MxGateway.Client.Tests/MxGatewayClientCliTests.cs +++ b/clients/dotnet/ZB.MOM.WW.MxGateway.Client.Tests/MxGatewayClientCliTests.cs @@ -519,6 +519,7 @@ public sealed class MxGatewayClientCliTests /// production , and asserted /// against exit code 0. /// + /// The alarm subcommand to validate (e.g. "stream-alarms", "acknowledge-alarm"). [Theory] [InlineData("stream-alarms")] [InlineData("acknowledge-alarm")] @@ -716,6 +717,7 @@ public sealed class MxGatewayClientCliTests /// bounds checking, so a negative value (e.g. -1) silently wraps /// to ~49.7 days. The fix must reject negatives with a clear error. /// + /// The bulk-read subcommand to validate (e.g. "read-bulk", "bench-read-bulk"). [Theory] [InlineData("read-bulk")] [InlineData("bench-read-bulk")] @@ -988,6 +990,7 @@ public sealed class MxGatewayClientCliTests /// Galaxy discover hierarchy reply to return. public DiscoverHierarchyReply GalaxyDiscoverHierarchyReply { get; set; } = new(); + /// Queue of galaxy discover hierarchy replies to return. public Queue GalaxyDiscoverHierarchyReplies { get; } = new(); /// List of received galaxy test connection requests. diff --git a/clients/dotnet/ZB.MOM.WW.MxGateway.Client/GalaxyRepositoryClient.cs b/clients/dotnet/ZB.MOM.WW.MxGateway.Client/GalaxyRepositoryClient.cs index dc4d50f..37eb422 100644 --- a/clients/dotnet/ZB.MOM.WW.MxGateway.Client/GalaxyRepositoryClient.cs +++ b/clients/dotnet/ZB.MOM.WW.MxGateway.Client/GalaxyRepositoryClient.cs @@ -182,6 +182,10 @@ public sealed class GalaxyRepositoryClient : IAsyncDisposable return await DiscoverHierarchyAsync(new DiscoverHierarchyOptions(), cancellationToken).ConfigureAwait(false); } + /// Discovers the Galaxy object hierarchy. + /// Client configuration options. + /// Token to observe for cancellation. + /// The collection of Galaxy objects in the hierarchy. public async Task> DiscoverHierarchyAsync( DiscoverHierarchyOptions options, CancellationToken cancellationToken = default) diff --git a/clients/dotnet/ZB.MOM.WW.MxGateway.Client/MxGatewayClientOptions.cs b/clients/dotnet/ZB.MOM.WW.MxGateway.Client/MxGatewayClientOptions.cs index 4c942d8..f66b56e 100644 --- a/clients/dotnet/ZB.MOM.WW.MxGateway.Client/MxGatewayClientOptions.cs +++ b/clients/dotnet/ZB.MOM.WW.MxGateway.Client/MxGatewayClientOptions.cs @@ -47,6 +47,9 @@ public sealed class MxGatewayClientOptions /// public TimeSpan? StreamTimeout { get; init; } + /// + /// Gets the maximum size in bytes for gRPC messages. + /// public int MaxGrpcMessageBytes { get; init; } = 16 * 1024 * 1024; ///