docs: backfill XML documentation across 756 files
v2-ci / build (push) Failing after 1m43s
v2-ci / unit-tests (tests/Core/ZB.MOM.WW.OtOpcUa.Cluster.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.ControlPlane.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.Security.Tests) (push) Has been skipped
v2-ci / integration (tests/Server/ZB.MOM.WW.OtOpcUa.Host.IntegrationTests) (push) Has been skipped
v2-ci / integration (tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.IntegrationTests) (push) Has been skipped
v2-ci / build (push) Failing after 1m43s
v2-ci / unit-tests (tests/Core/ZB.MOM.WW.OtOpcUa.Cluster.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.ControlPlane.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.Security.Tests) (push) Has been skipped
v2-ci / integration (tests/Server/ZB.MOM.WW.OtOpcUa.Host.IntegrationTests) (push) Has been skipped
v2-ci / integration (tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.IntegrationTests) (push) Has been skipped
Adds <summary>, <param>, <typeparam>, and <inheritdoc/> tags to public members surfaced by commentchecker — resolves 5,847 of 5,869 issues (99.6%) across three /fixdocs passes.
This commit is contained in:
+37
@@ -27,11 +27,24 @@ public sealed class GalaxyDriverSubscribeTests
|
||||
{
|
||||
private int _nextHandle = 1;
|
||||
private readonly Channel<MxEvent> _events = Channel.CreateUnbounded<MxEvent>();
|
||||
|
||||
/// <summary>Gets the mapping of tag references to subscription handles.</summary>
|
||||
public Dictionary<string, int> Map { get; } = new();
|
||||
|
||||
/// <summary>Gets the list of unsubscribed handles.</summary>
|
||||
public List<int> UnsubscribedHandles { get; } = [];
|
||||
|
||||
/// <summary>Gets the list of buffered intervals called.</summary>
|
||||
public List<int> BufferedIntervalsCalled { get; } = [];
|
||||
|
||||
/// <summary>Gets or sets a function to decide whether to accept a subscription.</summary>
|
||||
public Func<string, bool> Decide { get; set; } = _ => true;
|
||||
|
||||
/// <summary>Subscribes to bulk updates for the specified tag references.</summary>
|
||||
/// <param name="fullReferences">The tag references to subscribe to.</param>
|
||||
/// <param name="bufferedUpdateIntervalMs">The buffered update interval in milliseconds.</param>
|
||||
/// <param name="cancellationToken">Cancellation token for the operation.</param>
|
||||
/// <returns>A list of subscription results.</returns>
|
||||
public Task<IReadOnlyList<SubscribeResult>> SubscribeBulkAsync(
|
||||
IReadOnlyList<string> fullReferences, int bufferedUpdateIntervalMs, CancellationToken cancellationToken)
|
||||
{
|
||||
@@ -64,15 +77,27 @@ public sealed class GalaxyDriverSubscribeTests
|
||||
return Task.FromResult<IReadOnlyList<SubscribeResult>>(results);
|
||||
}
|
||||
|
||||
/// <summary>Unsubscribes from bulk updates for the specified item handles.</summary>
|
||||
/// <param name="itemHandles">The handles to unsubscribe.</param>
|
||||
/// <param name="cancellationToken">Cancellation token for the operation.</param>
|
||||
/// <returns>A completed task.</returns>
|
||||
public Task UnsubscribeBulkAsync(IReadOnlyList<int> itemHandles, CancellationToken cancellationToken)
|
||||
{
|
||||
UnsubscribedHandles.AddRange(itemHandles);
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
/// <summary>Streams events asynchronously.</summary>
|
||||
/// <param name="cancellationToken">Cancellation token for the operation.</param>
|
||||
/// <returns>An async enumerable of MX events.</returns>
|
||||
public IAsyncEnumerable<MxEvent> StreamEventsAsync(CancellationToken cancellationToken)
|
||||
=> _events.Reader.ReadAllAsync(cancellationToken);
|
||||
|
||||
/// <summary>Emits a data change event asynchronously.</summary>
|
||||
/// <param name="itemHandle">The handle of the item that changed.</param>
|
||||
/// <param name="value">The new value.</param>
|
||||
/// <param name="quality">The quality of the value.</param>
|
||||
/// <returns>A value task representing the asynchronous emission.</returns>
|
||||
public ValueTask EmitOnDataChangeAsync(int itemHandle, double value, byte quality = 192) =>
|
||||
_events.Writer.WriteAsync(new MxEvent
|
||||
{
|
||||
@@ -83,9 +108,11 @@ public sealed class GalaxyDriverSubscribeTests
|
||||
SourceTimestamp = Timestamp.FromDateTime(DateTime.UtcNow),
|
||||
});
|
||||
|
||||
/// <summary>Completes the event stream.</summary>
|
||||
public void CompleteEvents() => _events.Writer.Complete();
|
||||
}
|
||||
|
||||
/// <summary>Verifies subscription allocates a handle and dispatches value changes.</summary>
|
||||
[Fact]
|
||||
public async Task SubscribeAsync_AllocatesHandle_AndDispatchesValueChange()
|
||||
{
|
||||
@@ -108,6 +135,7 @@ public sealed class GalaxyDriverSubscribeTests
|
||||
((double)captured[0].Snapshot.Value!).ShouldBe(42.0);
|
||||
}
|
||||
|
||||
/// <summary>Verifies two subscriptions for the same tag each receive updates.</summary>
|
||||
[Fact]
|
||||
public async Task SubscribeAsync_TwoSubscriptions_SameTag_FanOutOnePerSubscription()
|
||||
{
|
||||
@@ -151,6 +179,7 @@ public sealed class GalaxyDriverSubscribeTests
|
||||
allowed.ShouldContain(captured0Id);
|
||||
}
|
||||
|
||||
/// <summary>Verifies failed subscriptions do not dispatch events.</summary>
|
||||
[Fact]
|
||||
public async Task SubscribeAsync_FailedTag_DoesNotDispatchEvents()
|
||||
{
|
||||
@@ -171,6 +200,7 @@ public sealed class GalaxyDriverSubscribeTests
|
||||
captured.ShouldBeEmpty();
|
||||
}
|
||||
|
||||
/// <summary>Verifies unsubscribe removes registration and calls gateway unsubscribe.</summary>
|
||||
[Fact]
|
||||
public async Task UnsubscribeAsync_RemovesRegistration_AndCallsGwUnsubscribe()
|
||||
{
|
||||
@@ -193,6 +223,7 @@ public sealed class GalaxyDriverSubscribeTests
|
||||
captured.ShouldBeEmpty();
|
||||
}
|
||||
|
||||
/// <summary>Verifies unsubscribing with an unknown handle is handled.</summary>
|
||||
[Fact]
|
||||
public async Task UnsubscribeAsync_UnknownHandle_NoOp()
|
||||
{
|
||||
@@ -207,6 +238,7 @@ public sealed class GalaxyDriverSubscribeTests
|
||||
driver.UnsubscribeAsync(foreignHandle, CancellationToken.None));
|
||||
}
|
||||
|
||||
/// <summary>Verifies subscription without a subscriber throws.</summary>
|
||||
[Fact]
|
||||
public async Task SubscribeAsync_NoSubscriber_Throws()
|
||||
{
|
||||
@@ -216,6 +248,7 @@ public sealed class GalaxyDriverSubscribeTests
|
||||
ex.Message.ShouldContain("PR 4.W");
|
||||
}
|
||||
|
||||
/// <summary>Verifies subscription falls back to configured interval when zero is passed.</summary>
|
||||
[Fact]
|
||||
public async Task SubscribeAsync_FallsBackToConfiguredInterval_WhenCallerPassesZero()
|
||||
{
|
||||
@@ -235,6 +268,7 @@ public sealed class GalaxyDriverSubscribeTests
|
||||
subscriber.BufferedIntervalsCalled.ShouldHaveSingleItem().ShouldBe(750);
|
||||
}
|
||||
|
||||
/// <summary>Verifies subscription respects caller's interval when non-zero.</summary>
|
||||
[Fact]
|
||||
public async Task SubscribeAsync_RespectsCallerInterval_WhenNonZero()
|
||||
{
|
||||
@@ -254,6 +288,7 @@ public sealed class GalaxyDriverSubscribeTests
|
||||
subscriber.BufferedIntervalsCalled.ShouldHaveSingleItem().ShouldBe(250);
|
||||
}
|
||||
|
||||
/// <summary>Verifies subscription with empty tag list returns handle without calling gateway.</summary>
|
||||
[Fact]
|
||||
public async Task SubscribeAsync_EmptyTagList_ReturnsHandleWithoutCallingGw()
|
||||
{
|
||||
@@ -266,8 +301,10 @@ public sealed class GalaxyDriverSubscribeTests
|
||||
subscriber.Map.ShouldBeEmpty();
|
||||
}
|
||||
|
||||
/// <summary>A subscription handle from a foreign source.</summary>
|
||||
private sealed class ForeignHandle : ISubscriptionHandle
|
||||
{
|
||||
/// <summary>Gets the diagnostic identifier for this handle.</summary>
|
||||
public string DiagnosticId => "foreign-x";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user