docs(tests): fix CommentChecker findings across tests/ — 13,392 → 0 (repo-wide scan clean)
Comment/XML-doc changes only: - add summaries to ~10k test methods, fixtures, fakes and helpers (+ <param> on theories, <returns> on async Task methods, <inheritdoc/> on interface implementations the checker can resolve) - strip ~2.6k project-tracking references (WP*, P*-*, row-NN, Task N, #NN, Component-0NN) from comments, keeping the explanatory text; reword false positives in comments only - real docs on fakes implementing BCL/library interfaces (IDisposable, ILogger, IOptionsMonitor, IAsyncLifetime) - reword the last 5 src/ false positives (CWE-1236, failures-1, year-0001, M365) Only non-comment edits: four one-line nested classes split across lines so members can carry docs. Build 0 errors / 0 warnings.
This commit is contained in:
@@ -8,13 +8,14 @@ using ZB.MOM.WW.ScadaBridge.SiteRuntime.Streaming;
|
||||
namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests.Streaming;
|
||||
|
||||
/// <summary>
|
||||
/// WP-23: Site-Wide Akka Stream tests.
|
||||
/// WP-25: Debug View Backend tests (subscribe/unsubscribe).
|
||||
/// Site-Wide Akka Stream tests.
|
||||
/// Debug View Backend tests (subscribe/unsubscribe).
|
||||
/// </summary>
|
||||
public class SiteStreamManagerTests : TestKit, IDisposable
|
||||
{
|
||||
private readonly SiteStreamManager _streamManager;
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="SiteStreamManagerTests"/> class.</summary>
|
||||
public SiteStreamManagerTests()
|
||||
{
|
||||
var options = new SiteRuntimeOptions { StreamBufferSize = 100 };
|
||||
@@ -23,11 +24,13 @@ public class SiteStreamManagerTests : TestKit, IDisposable
|
||||
_streamManager.Initialize(Sys);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
void IDisposable.Dispose()
|
||||
{
|
||||
Shutdown();
|
||||
}
|
||||
|
||||
/// <summary>Verifies the case: subscribe, creates Subscription.</summary>
|
||||
[Fact]
|
||||
public void Subscribe_CreatesSubscription()
|
||||
{
|
||||
@@ -38,6 +41,7 @@ public class SiteStreamManagerTests : TestKit, IDisposable
|
||||
Assert.Equal(1, _streamManager.SubscriptionCount);
|
||||
}
|
||||
|
||||
/// <summary>Verifies the case: unsubscribe, removes Subscription.</summary>
|
||||
[Fact]
|
||||
public void Unsubscribe_RemovesSubscription()
|
||||
{
|
||||
@@ -48,12 +52,14 @@ public class SiteStreamManagerTests : TestKit, IDisposable
|
||||
Assert.Equal(0, _streamManager.SubscriptionCount);
|
||||
}
|
||||
|
||||
/// <summary>Verifies the case: unsubscribe, invalid Id, returns False.</summary>
|
||||
[Fact]
|
||||
public void Unsubscribe_InvalidId_ReturnsFalse()
|
||||
{
|
||||
Assert.False(_streamManager.Unsubscribe("nonexistent"));
|
||||
}
|
||||
|
||||
/// <summary>Verifies the case: publish Attribute Value Changed, forwards To Subscriber.</summary>
|
||||
[Fact]
|
||||
public void PublishAttributeValueChanged_ForwardsToSubscriber()
|
||||
{
|
||||
@@ -69,6 +75,7 @@ public class SiteStreamManagerTests : TestKit, IDisposable
|
||||
Assert.Equal("Temperature", received.AttributeName);
|
||||
}
|
||||
|
||||
/// <summary>Verifies the case: publish Alarm State Changed, forwards To Subscriber.</summary>
|
||||
[Fact]
|
||||
public void PublishAlarmStateChanged_ForwardsToSubscriber()
|
||||
{
|
||||
@@ -84,6 +91,7 @@ public class SiteStreamManagerTests : TestKit, IDisposable
|
||||
Assert.Equal(AlarmState.Active, received.State);
|
||||
}
|
||||
|
||||
/// <summary>Verifies the case: publish Attribute Value Changed, filtersby Instance.</summary>
|
||||
[Fact]
|
||||
public void PublishAttributeValueChanged_FiltersbyInstance()
|
||||
{
|
||||
@@ -103,6 +111,7 @@ public class SiteStreamManagerTests : TestKit, IDisposable
|
||||
probe2.ExpectNoMsg(TimeSpan.FromMilliseconds(500));
|
||||
}
|
||||
|
||||
/// <summary>Verifies the case: subscribe Site Alarms, forwards Alarms For All Instances, but Not Attributes.</summary>
|
||||
[Fact]
|
||||
public void SubscribeSiteAlarms_ForwardsAlarmsForAllInstances_ButNotAttributes()
|
||||
{
|
||||
@@ -135,6 +144,7 @@ public class SiteStreamManagerTests : TestKit, IDisposable
|
||||
probe.ExpectNoMsg(TimeSpan.FromMilliseconds(500));
|
||||
}
|
||||
|
||||
/// <summary>Verifies the case: subscribe Site Alarms, subscription Removable Via Unsubscribe.</summary>
|
||||
[Fact]
|
||||
public void SubscribeSiteAlarms_SubscriptionRemovableViaUnsubscribe()
|
||||
{
|
||||
@@ -147,6 +157,7 @@ public class SiteStreamManagerTests : TestKit, IDisposable
|
||||
Assert.Equal(0, _streamManager.SubscriptionCount);
|
||||
}
|
||||
|
||||
/// <summary>Verifies the case: remove Subscriber, removes All Subscriptions For Actor.</summary>
|
||||
[Fact]
|
||||
public void RemoveSubscriber_RemovesAllSubscriptionsForActor()
|
||||
{
|
||||
@@ -160,10 +171,10 @@ public class SiteStreamManagerTests : TestKit, IDisposable
|
||||
Assert.Equal(0, _streamManager.SubscriptionCount);
|
||||
}
|
||||
|
||||
// ── WP2.6d: separate alarm publish path, drop counter, skip-at-zero-subscribers ──
|
||||
// ── separate alarm publish path, drop counter, skip-at-zero-subscribers ──
|
||||
|
||||
/// <summary>
|
||||
/// WP2.6d: alarm state changes now travel a dedicated publish source, isolated from
|
||||
/// Alarm state changes now travel a dedicated publish source, isolated from
|
||||
/// the (far higher-volume) attribute path — a burst of attribute events for OTHER
|
||||
/// instances, interleaved with an alarm-only subscriber's events, must not cause any
|
||||
/// alarm to be lost.
|
||||
@@ -176,7 +187,7 @@ public class SiteStreamManagerTests : TestKit, IDisposable
|
||||
|
||||
// A storm of attribute events for a DIFFERENT instance — none of which the
|
||||
// alarm subscriber is even listening to — interleaved with alarm events. Before
|
||||
// WP2.6d these shared one upstream buffer; now they are fully separate sources.
|
||||
// Previously these shared one upstream buffer; now they are fully separate sources.
|
||||
for (var i = 0; i < 500; i++)
|
||||
{
|
||||
_streamManager.PublishAttributeValueChanged(new AttributeValueChanged(
|
||||
@@ -191,7 +202,7 @@ public class SiteStreamManagerTests : TestKit, IDisposable
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// WP2.6d: with zero subscribers of any kind, PublishAlarmStateChanged/
|
||||
/// With zero subscribers of any kind, PublishAlarmStateChanged/
|
||||
/// PublishAttributeValueChanged must be no-ops — no exception, and (for alarms) the
|
||||
/// event never reaches the bounded hand-off queue, so
|
||||
/// <see cref="SiteStreamManager.AlarmPublishDroppedCount"/> stays at zero rather than
|
||||
@@ -217,7 +228,7 @@ public class SiteStreamManagerTests : TestKit, IDisposable
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// WP2.6d: once the bounded alarm hand-off queue (the exact factory
|
||||
/// Once the bounded alarm hand-off queue (the exact factory
|
||||
/// <see cref="SiteStreamManager.Initialize"/> wires into the drop-count callback) is
|
||||
/// full, a further write evicts the oldest queued item and fires the drop callback.
|
||||
/// Exercised directly against the queue factory — deterministic, no actor
|
||||
|
||||
Reference in New Issue
Block a user