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:
+41
@@ -11,6 +11,7 @@ namespace ZB.MOM.WW.OtOpcUa.Driver.Galaxy.Tests.Runtime;
|
||||
/// </summary>
|
||||
public sealed class SubscriptionRegistryTests
|
||||
{
|
||||
/// <summary>Verifies NextSubscriptionId() increments monotonically.</summary>
|
||||
[Fact]
|
||||
public void NextSubscriptionId_IsMonotonic()
|
||||
{
|
||||
@@ -20,6 +21,7 @@ public sealed class SubscriptionRegistryTests
|
||||
registry.NextSubscriptionId().ShouldBe(3);
|
||||
}
|
||||
|
||||
/// <summary>Verifies Register() and ResolveSubscribers() correctly store and return a single subscription.</summary>
|
||||
[Fact]
|
||||
public void Register_OneSubscription_OneTag_ResolvesSingleSubscriber()
|
||||
{
|
||||
@@ -32,6 +34,7 @@ public sealed class SubscriptionRegistryTests
|
||||
subs[0].FullReference.ShouldBe("Tank.Level");
|
||||
}
|
||||
|
||||
/// <summary>Verifies multiple subscriptions to the same tag are both indexed for fan-out.</summary>
|
||||
[Fact]
|
||||
public void Register_TwoSubscriptions_SameTag_FanOutToBoth()
|
||||
{
|
||||
@@ -44,6 +47,7 @@ public sealed class SubscriptionRegistryTests
|
||||
subs.Select(s => s.SubscriptionId).OrderBy(x => x).ShouldBe(new[] { 1L, 2L });
|
||||
}
|
||||
|
||||
/// <summary>Verifies failed item handles (rejected by gateway) are not indexed for fan-out.</summary>
|
||||
[Fact]
|
||||
public void Register_FailedItemHandle_NotIndexedForFanOut()
|
||||
{
|
||||
@@ -57,6 +61,7 @@ public sealed class SubscriptionRegistryTests
|
||||
registry.ResolveSubscribers(0).ShouldBeEmpty();
|
||||
}
|
||||
|
||||
/// <summary>Verifies Remove() drops all bindings and returns them.</summary>
|
||||
[Fact]
|
||||
public void Remove_DropsAllBindings_AndReturnsThemForUnsubscribe()
|
||||
{
|
||||
@@ -74,6 +79,7 @@ public sealed class SubscriptionRegistryTests
|
||||
registry.ResolveSubscribers(200).ShouldBeEmpty();
|
||||
}
|
||||
|
||||
/// <summary>Verifies removing one subscription of multiple leaves others intact.</summary>
|
||||
[Fact]
|
||||
public void Remove_OneOfTwoSubscriptions_LeavesOtherIntact()
|
||||
{
|
||||
@@ -88,6 +94,7 @@ public sealed class SubscriptionRegistryTests
|
||||
subs[0].SubscriptionId.ShouldBe(2);
|
||||
}
|
||||
|
||||
/// <summary>Verifies removing an unknown subscription returns null without error.</summary>
|
||||
[Fact]
|
||||
public void Remove_UnknownSubscription_IsNullSentinel()
|
||||
{
|
||||
@@ -95,6 +102,7 @@ public sealed class SubscriptionRegistryTests
|
||||
registry.Remove(999).ShouldBeNull();
|
||||
}
|
||||
|
||||
/// <summary>Verifies TrackedSubscriptionCount and TrackedItemHandleCount reflect registrations and removals.</summary>
|
||||
[Fact]
|
||||
public void TrackedCounts_ReflectAdditionsAndRemovals()
|
||||
{
|
||||
@@ -117,6 +125,7 @@ public sealed class SubscriptionRegistryTests
|
||||
|
||||
// ===== Driver.Galaxy-008 regression: reconnect replay rebinds with fresh handles =====
|
||||
|
||||
/// <summary>Verifies SnapshotEntries() groups bindings correctly by subscription ID.</summary>
|
||||
[Fact]
|
||||
public void SnapshotEntries_GroupsBindingsBySubscriptionId()
|
||||
{
|
||||
@@ -131,6 +140,7 @@ public sealed class SubscriptionRegistryTests
|
||||
entries.Single(e => e.SubscriptionId == 2).Bindings.Count.ShouldBe(2);
|
||||
}
|
||||
|
||||
/// <summary>Verifies Rebind() replaces stale handles with fresh post-reconnect handles.</summary>
|
||||
[Fact]
|
||||
public void Rebind_ReplacesStaleItemHandles_WithThePostReconnectHandles()
|
||||
{
|
||||
@@ -148,6 +158,7 @@ public sealed class SubscriptionRegistryTests
|
||||
subs[0].FullReference.ShouldBe("Tank.Level");
|
||||
}
|
||||
|
||||
/// <summary>Verifies Rebind() on one subscription does not affect others on the same old handle.</summary>
|
||||
[Fact]
|
||||
public void Rebind_LeavesOtherSubscriptionsOnTheSameOldHandleIntact()
|
||||
{
|
||||
@@ -162,6 +173,7 @@ public sealed class SubscriptionRegistryTests
|
||||
registry.ResolveSubscribers(555).Select(s => s.SubscriptionId).ShouldBe(new[] { 1L });
|
||||
}
|
||||
|
||||
/// <summary>Verifies Rebind() on an unknown subscription is a no-op.</summary>
|
||||
[Fact]
|
||||
public void Rebind_UnknownSubscription_IsNoOp()
|
||||
{
|
||||
@@ -170,6 +182,7 @@ public sealed class SubscriptionRegistryTests
|
||||
registry.ResolveSubscribers(1).ShouldBeEmpty();
|
||||
}
|
||||
|
||||
/// <summary>Verifies Rebind() does not index rejected item handles.</summary>
|
||||
[Fact]
|
||||
public void Rebind_FailedItemHandle_NotIndexedForFanOut()
|
||||
{
|
||||
@@ -185,6 +198,7 @@ public sealed class SubscriptionRegistryTests
|
||||
|
||||
// ===== Driver.Galaxy-012 regression: ResolveSubscribers is O(1) per binding =====
|
||||
|
||||
/// <summary>Verifies ResolveSubscribers() correctly dispatches in a large binding set without linear scan.</summary>
|
||||
[Fact]
|
||||
public void ResolveSubscribers_LargeBindingSet_DispatchesCorrectly()
|
||||
{
|
||||
@@ -215,23 +229,50 @@ public sealed class SubscriptionRegistryTests
|
||||
|
||||
// Internal types are accessed via friend assembly (InternalsVisibleTo); these
|
||||
// wrapper aliases keep the test code readable.
|
||||
/// <summary>Wrapper for accessing SubscriptionRegistry in tests via internal visibility.</summary>
|
||||
private sealed class SubscriptionRegistryAccess
|
||||
{
|
||||
/// <summary>The underlying SubscriptionRegistry instance.</summary>
|
||||
private readonly SubscriptionRegistry _inner = new();
|
||||
|
||||
/// <summary>Gets the count of tracked subscriptions.</summary>
|
||||
public int TrackedSubscriptionCount => _inner.TrackedSubscriptionCount;
|
||||
|
||||
/// <summary>Gets the count of tracked item handles.</summary>
|
||||
public int TrackedItemHandleCount => _inner.TrackedItemHandleCount;
|
||||
|
||||
/// <summary>Gets the next subscription ID.</summary>
|
||||
public long NextSubscriptionId() => _inner.NextSubscriptionId();
|
||||
|
||||
/// <summary>Registers a subscription with the given bindings.</summary>
|
||||
/// <param name="id">The subscription ID.</param>
|
||||
/// <param name="bindings">The tag bindings to register.</param>
|
||||
public void Register(long id, IReadOnlyList<TagBindingAccess> bindings)
|
||||
=> _inner.Register(id, [.. bindings.Select(b => new TagBinding(b.FullReference, b.ItemHandle))]);
|
||||
|
||||
/// <summary>Removes a subscription and returns its bindings.</summary>
|
||||
/// <param name="id">The subscription ID.</param>
|
||||
/// <returns>The bindings that were removed, or null if not found.</returns>
|
||||
public IReadOnlyList<TagBindingAccess>? Remove(long id)
|
||||
{
|
||||
var removed = _inner.Remove(id);
|
||||
return removed is null ? null : [.. removed.Select(b => new TagBindingAccess(b.FullReference, b.ItemHandle))];
|
||||
}
|
||||
|
||||
/// <summary>Resolves subscribers for the given item handle.</summary>
|
||||
/// <param name="handle">The item handle to look up.</param>
|
||||
/// <returns>The list of subscriptions observing this handle.</returns>
|
||||
public IReadOnlyList<(long SubscriptionId, string FullReference)> ResolveSubscribers(int handle)
|
||||
=> _inner.ResolveSubscribers(handle);
|
||||
|
||||
/// <summary>Rebinds a subscription to new item handles.</summary>
|
||||
/// <param name="id">The subscription ID.</param>
|
||||
/// <param name="bindings">The new tag bindings.</param>
|
||||
public void Rebind(long id, IReadOnlyList<TagBindingAccess> bindings)
|
||||
=> _inner.Rebind(id, [.. bindings.Select(b => new TagBinding(b.FullReference, b.ItemHandle))]);
|
||||
|
||||
/// <summary>Snapshots all subscription entries grouped by ID.</summary>
|
||||
/// <returns>All subscription entries with their bindings.</returns>
|
||||
public IReadOnlyList<(long SubscriptionId, IReadOnlyList<TagBindingAccess> Bindings)> SnapshotEntries()
|
||||
=> [.. _inner.SnapshotEntries().Select(e =>
|
||||
(e.SubscriptionId,
|
||||
|
||||
Reference in New Issue
Block a user