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
@@ -18,7 +18,7 @@ using DebugViewPage = ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages.Deploymen
namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Deployment;
/// <summary>
/// Regression tests for arch-review 2026-08-19 P6-6. <c>Connect()</c> awaits
/// Regression tests for a dispose race in the debug view. <c>Connect()</c> awaits
/// <c>StartStreamAsync</c> — which can take up to 30s — and then publishes the result into
/// <c>_session</c>. If the circuit was torn down inside that window, <c>Dispose()</c> had
/// already run, found <c>_session</c> still null and stopped nothing, so the just-created
@@ -40,12 +40,17 @@ public class DebugViewConnectDisposeRaceTests : BunitContext
private readonly TaskCompletionSource _entered = new(TaskCreationOptions.RunContinuationsAsynchronously);
private readonly List<string> _stopped = new();
/// <summary>Creates a debug stream service whose stream start is held until released.</summary>
/// <param name="comms">The communication service.</param>
/// <param name="provider">The service provider.</param>
/// <param name="factory">The gRPC client factory.</param>
public GatedDebugStreamService(
CommunicationService comms, IServiceProvider provider, SiteStreamGrpcClientFactory factory)
: base(comms, provider, factory, NullLogger<DebugStreamService>.Instance)
{
}
/// <summary>The id of the session this service hands out.</summary>
public string SessionId => "session-under-test";
/// <summary>Completes once <see cref="StartStreamAsync"/> has been entered.</summary>
@@ -57,8 +62,10 @@ public class DebugViewConnectDisposeRaceTests : BunitContext
get { lock (_stopped) { return _stopped.ToList(); } }
}
/// <summary>Releases the held stream start so it can complete.</summary>
public void ReleaseStart() => _gate.TrySetResult();
/// <inheritdoc />
public override async Task<DebugStreamSession> StartStreamAsync(
int instanceId, Action<object> onEvent, Action onTerminated, CancellationToken ct = default)
{
@@ -73,6 +80,7 @@ public class DebugViewConnectDisposeRaceTests : BunitContext
DateTimeOffset.UtcNow));
}
/// <inheritdoc />
public override void StopStream(string sessionId)
{
lock (_stopped) { _stopped.Add(sessionId); }
@@ -82,7 +90,10 @@ public class DebugViewConnectDisposeRaceTests : BunitContext
private sealed class StubAuthStateProvider : AuthenticationStateProvider
{
private readonly AuthenticationState _state;
/// <summary>Creates a provider that always returns the given authentication state.</summary>
/// <param name="state">The authentication state to return.</param>
public StubAuthStateProvider(AuthenticationState state) => _state = state;
/// <inheritdoc />
public override Task<AuthenticationState> GetAuthenticationStateAsync()
=> Task.FromResult(_state);
}
@@ -141,6 +152,8 @@ public class DebugViewConnectDisposeRaceTests : BunitContext
return task!;
}
/// <summary>Verifies that disposing during a pending connect stops the just-created session.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task Connect_DisposedMidStart_StopsTheJustCreatedSession()
{
@@ -162,6 +175,8 @@ public class DebugViewConnectDisposeRaceTests : BunitContext
Assert.Null(GetField(cut.Instance, "_session"));
}
/// <summary>Verifies that connecting and then disposing stops the session exactly once.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task Connect_ThenDispose_StopsTheSessionExactlyOnce()
{
@@ -186,6 +201,8 @@ public class DebugViewConnectDisposeRaceTests : BunitContext
Assert.Equal(new[] { stream.SessionId }, stream.Stopped);
}
/// <summary>Verifies that disconnecting after a connect stops the session once and clears the session slot.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task Disconnect_AfterConnect_StopsTheSessionOnceAndClearsTheSlot()
{