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
@@ -16,7 +16,7 @@ using ZB.MOM.WW.ScadaBridge.HealthMonitoring;
namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Services;
/// <summary>
/// Service-level tests for <see cref="AuditLogQueryService"/> (#23 M7-T3). The
/// Service-level tests for <see cref="AuditLogQueryService"/>. The
/// service is a thin pass-through over <see cref="IAuditLogRepository.QueryAsync"/>;
/// these tests pin the filter forwarding contract and the 100-row default-page-size
/// rule the grid relies on.
@@ -30,13 +30,15 @@ public class AuditLogQueryServiceTests
return agg;
}
/// <summary>Verifies that QueryAsync forwards the filter and paging to the repository.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task QueryAsync_ForwardsFilterAndPaging_ToRepository()
{
var repo = Substitute.For<IAuditLogRepository>();
var filter = new AuditLogQueryFilter(Channels: new[] { AuditChannel.ApiOutbound });
var paging = new AuditLogPaging(PageSize: 25);
// C3 (Task 2.5): the repository returns canonical ZB.MOM.WW.Audit.AuditEvent rows;
// The repository returns canonical ZB.MOM.WW.Audit.AuditEvent rows;
// the service decomposes each into a flat AuditEventView for the UI.
var eventId = Guid.NewGuid();
var repoRows = new List<AuditEvent>
@@ -64,6 +66,8 @@ public class AuditLogQueryServiceTests
await repo.Received(1).QueryAsync(filter, paging, Arg.Any<CancellationToken>());
}
/// <summary>Verifies that QueryAsync applies the default page size when none is specified.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task QueryAsync_AppliesDefaultPageSize_WhenNotSpecified()
{
@@ -84,9 +88,11 @@ public class AuditLogQueryServiceTests
}
// ─────────────────────────────────────────────────────────────────────────
// M7-T13 Bundle E: GetKpiSnapshotAsync — composes repo + health-aggregator
// GetKpiSnapshotAsync — composes repo + health-aggregator
// ─────────────────────────────────────────────────────────────────────────
/// <summary>Verifies that GetKpiSnapshotAsync forwards to the repository and adds the backlog reported by the health aggregator.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task GetKpiSnapshotAsync_ForwardsToRepo_AddsBacklogFromHealthAggregator()
{
@@ -127,6 +133,8 @@ public class AuditLogQueryServiceTests
Arg.Any<CancellationToken>());
}
/// <summary>Verifies that a site without a backlog snapshot contributes zero to the KPI backlog.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task GetKpiSnapshotAsync_SiteWithoutBacklogSnapshot_ContributesZero()
{
@@ -153,7 +161,7 @@ public class AuditLogQueryServiceTests
}
// ─────────────────────────────────────────────────────────────────────────
// #23 M7 — DbContext concurrency race regression (Bundle H follow-up)
// DbContext concurrency race regression
//
// The drill-in deep link (/audit/log?correlationId=…) triggers an OnInitialized
// auto-load query that races AuditFilterBar.GetAllSitesAsync() on the SAME
@@ -164,6 +172,8 @@ public class AuditLogQueryServiceTests
// context — these tests pin that contract.
// ─────────────────────────────────────────────────────────────────────────
/// <summary>Verifies that concurrent queries do not race on a shared database context.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task AuditLogQueryService_ConcurrentQueries_DoNotRace()
{
@@ -205,6 +215,8 @@ public class AuditLogQueryServiceTests
Assert.All(results, Assert.NotNull);
}
/// <summary>Verifies that QueryAsync opens a fresh service scope for each call rather than sharing one across calls.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task QueryAsync_OpensFreshScopePerCall_NotSharedAcrossCalls()
{
@@ -236,11 +248,13 @@ public class AuditLogQueryServiceTests
}
// ─────────────────────────────────────────────────────────────────────────
// Audit Log ParentExecutionId feature (Task 10): GetExecutionTreeAsync —
// Audit Log ParentExecutionId feature: GetExecutionTreeAsync —
// a thin pass-through over IAuditLogRepository.GetExecutionTreeAsync, mirroring
// QueryAsync's scope-per-call contract on the production path.
// ─────────────────────────────────────────────────────────────────────────
/// <summary>Verifies that GetExecutionTreeAsync forwards the execution ID to the repository.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task GetExecutionTreeAsync_ForwardsExecutionId_ToRepository()
{
@@ -265,6 +279,8 @@ public class AuditLogQueryServiceTests
await repo.Received(1).GetExecutionTreeAsync(executionId, Arg.Any<CancellationToken>());
}
/// <summary>Verifies that GetExecutionTreeAsync opens a fresh scope for each call when built with the production constructor.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task GetExecutionTreeAsync_OpensFreshScopePerCall_OnProductionCtor()
{
@@ -301,9 +317,11 @@ public class AuditLogQueryServiceTests
}
// ─────────────────────────────────────────────────────────────────────────
// Task 15: SourceNode filter forwarding + distinct-nodes service contract.
// SourceNode filter forwarding + distinct-nodes service contract.
// ─────────────────────────────────────────────────────────────────────────
/// <summary>Verifies that QueryAsync forwards the source nodes filter to the repository.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task QueryAsync_ForwardsSourceNodesFilter_ToRepository()
{
@@ -329,6 +347,8 @@ public class AuditLogQueryServiceTests
Arg.Any<CancellationToken>());
}
/// <summary>Verifies that GetDistinctSourceNodesAsync forwards to the repository on the first call.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task GetDistinctSourceNodesAsync_ForwardsToRepository_OnFirstCall()
{
@@ -345,6 +365,8 @@ public class AuditLogQueryServiceTests
await repo.Received(1).GetDistinctSourceNodesAsync(Arg.Any<CancellationToken>());
}
/// <summary>Verifies that GetDistinctSourceNodesAsync caches the snapshot across repeated calls.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task GetDistinctSourceNodesAsync_CachesSnapshot_AcrossRepeatedCalls()
{