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:
Joseph Doherty
2026-10-07 15:05:49 -04:00
parent 0ffd4bdbea
commit 513fa1aa16
998 changed files with 17896 additions and 2395 deletions
@@ -15,7 +15,7 @@ using ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests.TestSupport;
namespace ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests;
/// <summary>
/// Task 15: Tests for the <see cref="NotificationOutboxActor"/> query surface — the
/// Tests for the <see cref="NotificationOutboxActor"/> query surface — the
/// paginated outbox query, single-notification status query, manual retry and discard
/// of parked notifications, and the KPI snapshot.
/// </summary>
@@ -60,6 +60,7 @@ public class NotificationOutboxActorQueryTests : TestKit
};
}
/// <summary>Verifies that the query passes the request filter to the repository and maps rows to summaries.</summary>
[Fact]
public void Query_PassesFilterFromRequest_AndMapsRowsToSummaries()
{
@@ -115,6 +116,7 @@ public class NotificationOutboxActorQueryTests : TestKit
Assert.Equal("site-1", staleSummary.SourceSiteId);
}
/// <summary>Verifies that a notification id filter is passed to the repository as an exact match.</summary>
[Fact]
public void Query_WithNotificationIdFilter_PassesExactMatchToRepositoryFilter()
{
@@ -149,6 +151,7 @@ public class NotificationOutboxActorQueryTests : TestKit
1, 50, Arg.Any<CancellationToken>());
}
/// <summary>Verifies that a status filter string is parsed to the status enum on the repository filter.</summary>
[Fact]
public void Query_WithStatusFilterString_ParsesToEnumOnFilter()
{
@@ -183,10 +186,11 @@ public class NotificationOutboxActorQueryTests : TestKit
1, 50, Arg.Any<CancellationToken>());
}
/// <summary>Verifies that the source node filter is passed through and the source node is projected onto each summary.</summary>
[Fact]
public void Query_PassesSourceNodeFilter_AndProjectsSourceNodeOntoSummary()
{
// Task 16: the Notifications page's new Node filter input pushes a
// The Notifications page's new Node filter input pushes a
// value into NotificationOutboxQueryRequest.SourceNodeFilter; the actor
// must thread it onto NotificationOutboxFilter.SourceNode AND mirror
// the row's SourceNode column onto the response summaries.
@@ -222,6 +226,7 @@ public class NotificationOutboxActorQueryTests : TestKit
1, 50, Arg.Any<CancellationToken>());
}
/// <summary>Verifies that a repository failure during a query replies with a failure and an empty list.</summary>
[Fact]
public void Query_RepositoryThrows_RepliesFailureWithEmptyList()
{
@@ -243,6 +248,9 @@ public class NotificationOutboxActorQueryTests : TestKit
Assert.Empty(response.Notifications);
}
/// <summary>Verifies that a status query is answered as found only when the verified site owns the stored notification.</summary>
/// <param name="verifiedSite">The site id the caller is verified as.</param>
/// <param name="found">Whether the status query is expected to report the notification as found.</param>
[Theory]
[InlineData("site-1", true)]
[InlineData("site-other", false)]
@@ -256,6 +264,7 @@ public class NotificationOutboxActorQueryTests : TestKit
if (!found) { Assert.Null(response.LastError); Assert.Empty(response.Status); }
}
/// <summary>Verifies that a status query for an existing notification replies with the row detail.</summary>
[Fact]
public void StatusQuery_Found_RepliesWithRowDetail()
{
@@ -274,6 +283,7 @@ public class NotificationOutboxActorQueryTests : TestKit
Assert.Equal("smtp timeout", response.LastError);
}
/// <summary>Verifies that a status query for a missing notification replies that it was not found.</summary>
[Fact]
public void StatusQuery_NotFound_RepliesFoundFalse()
{
@@ -290,6 +300,7 @@ public class NotificationOutboxActorQueryTests : TestKit
Assert.Equal(0, response.RetryCount);
}
/// <summary>Verifies that retrying a parked notification resets it to Pending and succeeds.</summary>
[Fact]
public void Retry_ParkedNotification_ResetsToPending_AndSucceeds()
{
@@ -315,6 +326,7 @@ public class NotificationOutboxActorQueryTests : TestKit
Arg.Any<CancellationToken>());
}
/// <summary>Verifies that retrying a notification that is not parked fails.</summary>
[Fact]
public void Retry_NonParkedNotification_Fails()
{
@@ -330,6 +342,7 @@ public class NotificationOutboxActorQueryTests : TestKit
_repository.DidNotReceive().TryUpdateFromParkedAsync(Arg.Any<Notification>(), Arg.Any<CancellationToken>());
}
/// <summary>Verifies that retrying a missing notification fails.</summary>
[Fact]
public void Retry_MissingNotification_Fails()
{
@@ -348,7 +361,7 @@ public class NotificationOutboxActorQueryTests : TestKit
/// <summary>
/// The row is read successfully but the retention purge deletes it before the
/// write lands, so the CAS write matches nothing. The re-read that follows a
/// lost CAS (arch-review 2026-08-19 P5-4) finds nothing either, and the
/// lost CAS finds nothing either, and the
/// operator must be told the notification is gone — reporting a re-queue
/// that never happened is what a blind ExecuteUpdate would silently do (the
/// pre-ExecuteUpdate predecessor threw DbUpdateConcurrencyException here).
@@ -391,8 +404,8 @@ public class NotificationOutboxActorQueryTests : TestKit
}
/// <summary>
/// PROOF OF FAILURE for arch-review 2026-08-19 P5-4. Models the race the
/// finding describes: the operator's read sees Parked, but by the time the
/// Proof of failure for the lost-CAS race. Models the race in which
/// the operator's read sees Parked, but by the time the
/// write lands the dispatcher has already delivered the row (a detached
/// PipeTo task interleaving with the dispatcher's own write). The mechanism
/// is proven deterministically via a mocked call sequence, not a wall-clock
@@ -459,6 +472,7 @@ public class NotificationOutboxActorQueryTests : TestKit
_repository.DidNotReceive().UpdateAsync(Arg.Any<Notification>(), Arg.Any<CancellationToken>());
}
/// <summary>Verifies that discarding a parked notification marks it Discarded and succeeds.</summary>
[Fact]
public void Discard_ParkedNotification_MarksDiscarded_AndSucceeds()
{
@@ -477,6 +491,7 @@ public class NotificationOutboxActorQueryTests : TestKit
Arg.Any<CancellationToken>());
}
/// <summary>Verifies that discarding a notification that is not parked fails.</summary>
[Fact]
public void Discard_NonParkedNotification_Fails()
{
@@ -492,6 +507,7 @@ public class NotificationOutboxActorQueryTests : TestKit
_repository.DidNotReceive().TryUpdateFromParkedAsync(Arg.Any<Notification>(), Arg.Any<CancellationToken>());
}
/// <summary>Verifies that discarding a missing notification fails.</summary>
[Fact]
public void Discard_MissingNotification_Fails()
{
@@ -506,6 +522,7 @@ public class NotificationOutboxActorQueryTests : TestKit
Assert.Contains("not found", response.ErrorMessage);
}
/// <summary>Verifies that a detail request for a known id returns the full detail with the body and resolved targets.</summary>
[Fact]
public void DetailRequest_KnownId_ReturnsFullDetail_WithBodyAndResolvedTargets()
{
@@ -545,6 +562,7 @@ public class NotificationOutboxActorQueryTests : TestKit
Assert.Equal("node-a", detail.SourceNode);
}
/// <summary>Verifies that a detail request for an unknown id returns not found.</summary>
[Fact]
public void DetailRequest_UnknownId_ReturnsNotFound()
{
@@ -562,6 +580,7 @@ public class NotificationOutboxActorQueryTests : TestKit
Assert.Contains("not found", response.ErrorMessage);
}
/// <summary>Verifies that a KPI request computes the KPIs and maps the snapshot.</summary>
[Fact]
public void KpiRequest_ComputesKpis_AndMapsSnapshot()
{
@@ -592,6 +611,7 @@ public class NotificationOutboxActorQueryTests : TestKit
Arg.Any<DateTimeOffset>(), Arg.Any<DateTimeOffset>(), Arg.Any<CancellationToken>());
}
/// <summary>Verifies that a repository failure during a KPI request replies with a failure response.</summary>
[Fact]
public void KpiRequest_RepositoryThrows_RepliesFailureResponse()
{
@@ -615,6 +635,7 @@ public class NotificationOutboxActorQueryTests : TestKit
Assert.Null(response.OldestPendingAge);
}
/// <summary>Verifies that a per-site KPI request replies with per-site snapshots.</summary>
[Fact]
public void PerSiteKpiRequest_RepliesWithPerSiteSnapshots()
{
@@ -639,6 +660,7 @@ public class NotificationOutboxActorQueryTests : TestKit
Arg.Any<DateTimeOffset>(), Arg.Any<DateTimeOffset>(), Arg.Any<CancellationToken>());
}
/// <summary>Verifies that a repository fault during a per-site KPI request replies unsuccessfully.</summary>
[Fact]
public void PerSiteKpiRequest_RepositoryFault_RepliesUnsuccessful()
{
@@ -657,8 +679,9 @@ public class NotificationOutboxActorQueryTests : TestKit
Assert.Empty(response.Sites);
}
// ── Per-node KPI (T6: M5.2 per-node stuck-count KPIs) ──────────────────
// ── Per-node KPI (per-node stuck-count KPIs) ──────────────────
/// <summary>Verifies that a per-node KPI request replies with per-node snapshots.</summary>
[Fact]
public void PerNodeKpiRequest_RepliesWithPerNodeSnapshots()
{
@@ -685,6 +708,7 @@ public class NotificationOutboxActorQueryTests : TestKit
Arg.Any<DateTimeOffset>(), Arg.Any<DateTimeOffset>(), Arg.Any<CancellationToken>());
}
/// <summary>Verifies that a repository fault during a per-node KPI request replies unsuccessfully.</summary>
[Fact]
public void PerNodeKpiRequest_RepositoryFault_RepliesUnsuccessful()
{