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:
+5
@@ -14,6 +14,7 @@ namespace ZB.MOM.WW.OtOpcUa.Driver.Galaxy.Tests.Health;
|
||||
/// </summary>
|
||||
public sealed class HostConnectivityForwarderTests
|
||||
{
|
||||
/// <summary>Verifies that SetTransport pushes the state change under the client name.</summary>
|
||||
[Fact]
|
||||
public void SetTransport_Running_PushesUnderClientName()
|
||||
{
|
||||
@@ -30,6 +31,7 @@ public sealed class HostConnectivityForwarderTests
|
||||
agg.Snapshot()[0].HostName.ShouldBe("OtOpcUa-A");
|
||||
}
|
||||
|
||||
/// <summary>Verifies that SetTransport fires a change event on state transitions.</summary>
|
||||
[Fact]
|
||||
public void SetTransport_StateTransition_FiresChange()
|
||||
{
|
||||
@@ -47,6 +49,7 @@ public sealed class HostConnectivityForwarderTests
|
||||
captured[0].NewState.ShouldBe(HostState.Stopped);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that repeated identical state changes do not fire events.</summary>
|
||||
[Fact]
|
||||
public void SetTransport_RepeatedSameState_DoesNotFire()
|
||||
{
|
||||
@@ -64,6 +67,7 @@ public sealed class HostConnectivityForwarderTests
|
||||
captured.ShouldBeEmpty();
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the constructor rejects empty client names.</summary>
|
||||
[Fact]
|
||||
public void Constructor_RejectsEmptyClientName()
|
||||
{
|
||||
@@ -72,6 +76,7 @@ public sealed class HostConnectivityForwarderTests
|
||||
Should.Throw<ArgumentException>(() => new HostConnectivityForwarder(" ", agg));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that SetTransport throws after the forwarder is disposed.</summary>
|
||||
[Fact]
|
||||
public void SetTransport_AfterDispose_Throws()
|
||||
{
|
||||
|
||||
+9
@@ -15,6 +15,7 @@ public sealed class HostStatusAggregatorTests
|
||||
private static HostConnectivityStatus Status(string host, HostState state) =>
|
||||
new(host, state, DateTime.UtcNow);
|
||||
|
||||
/// <summary>Verifies that snapshot is empty when nothing is tracked.</summary>
|
||||
[Fact]
|
||||
public void Snapshot_Empty_WhenNothingTracked()
|
||||
{
|
||||
@@ -22,6 +23,7 @@ public sealed class HostStatusAggregatorTests
|
||||
agg.Snapshot().ShouldBeEmpty();
|
||||
}
|
||||
|
||||
/// <summary>Verifies that updating a new host fires a change event with Unknown as previous state.</summary>
|
||||
[Fact]
|
||||
public void Update_NewHost_FiresChange_PreviousIsUnknown()
|
||||
{
|
||||
@@ -37,6 +39,7 @@ public sealed class HostStatusAggregatorTests
|
||||
captured[0].NewState.ShouldBe(HostState.Running);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that updating to the same state does not fire a change event.</summary>
|
||||
[Fact]
|
||||
public void Update_SameState_DoesNotFire()
|
||||
{
|
||||
@@ -51,6 +54,7 @@ public sealed class HostStatusAggregatorTests
|
||||
captured.ShouldBeEmpty();
|
||||
}
|
||||
|
||||
/// <summary>Verifies that state transitions fire change events with correct old and new states.</summary>
|
||||
[Fact]
|
||||
public void Update_StateTransition_FiresChangeWithCorrectPreviousAndNew()
|
||||
{
|
||||
@@ -67,6 +71,7 @@ public sealed class HostStatusAggregatorTests
|
||||
captured[0].NewState.ShouldBe(HostState.Stopped);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that snapshot reflects every upserted host.</summary>
|
||||
[Fact]
|
||||
public void Snapshot_ReflectsEveryUpsertedHost()
|
||||
{
|
||||
@@ -82,6 +87,7 @@ public sealed class HostStatusAggregatorTests
|
||||
snap.First(s => s.HostName == "PlatformB").State.ShouldBe(HostState.Stopped);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that host name comparison is case-insensitive.</summary>
|
||||
[Fact]
|
||||
public void Update_HostNameComparison_IsCaseInsensitive()
|
||||
{
|
||||
@@ -98,6 +104,7 @@ public sealed class HostStatusAggregatorTests
|
||||
agg.Snapshot().Count.ShouldBe(1);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that removing a tracked host returns true and drops it from snapshot.</summary>
|
||||
[Fact]
|
||||
public void Remove_TrackedHost_ReturnsTrue_AndDropsFromSnapshot()
|
||||
{
|
||||
@@ -107,6 +114,7 @@ public sealed class HostStatusAggregatorTests
|
||||
agg.Snapshot().ShouldBeEmpty();
|
||||
}
|
||||
|
||||
/// <summary>Verifies that removing an unknown host returns false.</summary>
|
||||
[Fact]
|
||||
public void Remove_UnknownHost_ReturnsFalse()
|
||||
{
|
||||
@@ -114,6 +122,7 @@ public sealed class HostStatusAggregatorTests
|
||||
agg.Remove("Nope").ShouldBeFalse();
|
||||
}
|
||||
|
||||
/// <summary>Verifies that concurrent updates do not corrupt the internal dictionary.</summary>
|
||||
[Fact]
|
||||
public void ConcurrentUpdates_DoNotCorruptDictionary()
|
||||
{
|
||||
|
||||
+27
@@ -17,12 +17,20 @@ public sealed class PerPlatformProbeWatcherTests
|
||||
{
|
||||
private sealed class FakeSubscriber : IGalaxySubscriber
|
||||
{
|
||||
/// <summary>Gets a list of all subscribe requests made to the subscriber.</summary>
|
||||
public List<List<string>> Subscribes { get; } = [];
|
||||
/// <summary>Gets the buffered update intervals used in each subscribe request.</summary>
|
||||
public List<int> SubscribeIntervalsMs { get; } = [];
|
||||
/// <summary>Gets a list of all unsubscribe requests made to the subscriber.</summary>
|
||||
public List<List<int>> Unsubscribes { get; } = [];
|
||||
private int _nextHandle = 1;
|
||||
/// <summary>Gets a mapping of tag addresses to their assigned item handles.</summary>
|
||||
public Dictionary<string, int> HandleByAddress { get; } = new(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
/// <summary>Simulates a bulk subscribe operation by generating handles for each reference.</summary>
|
||||
/// <param name="fullReferences">The list of tag addresses to subscribe to.</param>
|
||||
/// <param name="bufferedUpdateIntervalMs">The buffered update interval in milliseconds.</param>
|
||||
/// <param name="cancellationToken">The cancellation token for the operation.</param>
|
||||
public Task<IReadOnlyList<SubscribeResult>> SubscribeBulkAsync(
|
||||
IReadOnlyList<string> fullReferences, int bufferedUpdateIntervalMs, CancellationToken cancellationToken)
|
||||
{
|
||||
@@ -43,12 +51,17 @@ public sealed class PerPlatformProbeWatcherTests
|
||||
return Task.FromResult<IReadOnlyList<SubscribeResult>>(results);
|
||||
}
|
||||
|
||||
/// <summary>Simulates a bulk unsubscribe operation by recording the handles.</summary>
|
||||
/// <param name="itemHandles">The list of item handles to unsubscribe.</param>
|
||||
/// <param name="cancellationToken">The cancellation token for the operation.</param>
|
||||
public Task UnsubscribeBulkAsync(IReadOnlyList<int> itemHandles, CancellationToken cancellationToken)
|
||||
{
|
||||
Unsubscribes.Add([.. itemHandles]);
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
/// <summary>Returns an empty event stream for testing.</summary>
|
||||
/// <param name="cancellationToken">The cancellation token for the operation.</param>
|
||||
public IAsyncEnumerable<MxEvent> StreamEventsAsync(CancellationToken cancellationToken)
|
||||
=> Empty();
|
||||
|
||||
@@ -59,6 +72,7 @@ public sealed class PerPlatformProbeWatcherTests
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Verifies that syncing platforms subscribes to the ScanState address for each platform.</summary>
|
||||
[Fact]
|
||||
public async Task SyncPlatformsAsync_SubscribesScanStateAddressForEachPlatform()
|
||||
{
|
||||
@@ -73,6 +87,7 @@ public sealed class PerPlatformProbeWatcherTests
|
||||
watcher.WatchedPlatforms.OrderBy(x => x).ShouldBe(new[] { "PlatformA", "PlatformB" });
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the default buffered interval is zero, matching gateway cadence.</summary>
|
||||
[Fact]
|
||||
public async Task SyncPlatformsAsync_DefaultBufferedIntervalIsZero_GwCadence()
|
||||
{
|
||||
@@ -84,6 +99,7 @@ public sealed class PerPlatformProbeWatcherTests
|
||||
subscriber.SubscribeIntervalsMs.ShouldHaveSingleItem().ShouldBe(0);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a configured buffered interval is forwarded to the gateway.</summary>
|
||||
[Fact]
|
||||
public async Task SyncPlatformsAsync_ConfiguredBufferedInterval_IsForwardedToGw()
|
||||
{
|
||||
@@ -99,6 +115,7 @@ public sealed class PerPlatformProbeWatcherTests
|
||||
subscriber.SubscribeIntervalsMs.ShouldHaveSingleItem().ShouldBe(250);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the constructor rejects negative buffered intervals.</summary>
|
||||
[Fact]
|
||||
public void Constructor_RejectsNegativeBufferedInterval()
|
||||
{
|
||||
@@ -107,6 +124,7 @@ public sealed class PerPlatformProbeWatcherTests
|
||||
new PerPlatformProbeWatcher(subscriber, new HostStatusAggregator(), bufferedUpdateIntervalMs: -1));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that syncing the same platform set twice does not resubscribe.</summary>
|
||||
[Fact]
|
||||
public async Task SyncPlatformsAsync_SameSetTwice_DoesNotResubscribe()
|
||||
{
|
||||
@@ -120,6 +138,7 @@ public sealed class PerPlatformProbeWatcherTests
|
||||
subscriber.Subscribes.Count.ShouldBe(1);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that removed platforms are unsubscribed and dropped from the aggregator.</summary>
|
||||
[Fact]
|
||||
public async Task SyncPlatformsAsync_RemovedPlatforms_AreUnsubscribed_AndDroppedFromAggregator()
|
||||
{
|
||||
@@ -142,6 +161,10 @@ public sealed class PerPlatformProbeWatcherTests
|
||||
aggregator.Snapshot().Any(s => s.HostName == "B").ShouldBeFalse();
|
||||
}
|
||||
|
||||
/// <summary>Verifies that DecodeState correctly decodes ScanState values and quality bytes across multiple pin configurations.</summary>
|
||||
/// <param name="value">The probe value to decode.</param>
|
||||
/// <param name="qualityByte">The OPC UA quality byte indicating data validity.</param>
|
||||
/// <param name="expected">The expected decoded host state.</param>
|
||||
[Theory]
|
||||
[InlineData(true, (byte)192, HostState.Running)]
|
||||
[InlineData(false, (byte)192, HostState.Stopped)]
|
||||
@@ -159,6 +182,7 @@ public sealed class PerPlatformProbeWatcherTests
|
||||
PerPlatformProbeWatcher.DecodeState(value, qualityByte).ShouldBe(expected);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a running probe value is routed to the aggregator.</summary>
|
||||
[Fact]
|
||||
public async Task OnProbeValueChanged_Running_RoutesToAggregator()
|
||||
{
|
||||
@@ -173,6 +197,7 @@ public sealed class PerPlatformProbeWatcherTests
|
||||
snap.State.ShouldBe(HostState.Running);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a probe value with bad quality routes as unknown state.</summary>
|
||||
[Fact]
|
||||
public async Task OnProbeValueChanged_BadQuality_RoutesUnknown()
|
||||
{
|
||||
@@ -186,6 +211,7 @@ public sealed class PerPlatformProbeWatcherTests
|
||||
aggregator.Snapshot().Single(s => s.HostName == "PlatformA").State.ShouldBe(HostState.Unknown);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that foreign probe references are silently dropped.</summary>
|
||||
[Fact]
|
||||
public async Task OnProbeValueChanged_ForeignReference_IsSilentlyDropped()
|
||||
{
|
||||
@@ -204,6 +230,7 @@ public sealed class PerPlatformProbeWatcherTests
|
||||
aggregator.Snapshot().Any(s => s.HostName == "Stranger").ShouldBeFalse();
|
||||
}
|
||||
|
||||
/// <summary>Verifies that dispose unsubscribes all tracked platforms.</summary>
|
||||
[Fact]
|
||||
public async Task Dispose_UnsubscribesAllTrackedPlatforms()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user