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
@@ -7,7 +7,7 @@ using Microsoft.Extensions.Options;
namespace ZB.MOM.WW.ScadaBridge.InboundAPI.Tests;
/// <summary>
/// InboundAPI-006 / InboundAPI-008: the POST /api/{methodName} endpoint must be
/// The POST /api/{methodName} endpoint must be
/// gated to the active central node and must cap the request body size. These
/// behaviours are enforced by <see cref="InboundApiEndpointFilter"/>.
/// </summary>
@@ -46,8 +46,10 @@ public class EndpointGatingTests
};
}
// --- InboundAPI-008: standby node must not serve inbound API calls ---
// --- Standby node must not serve inbound API calls ---
/// <summary>Verifies that a standby node short-circuits with a 503 and does not run the handler.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task StandbyNode_ShortCircuitsWith503_AndDoesNotRunHandler()
{
@@ -61,6 +63,8 @@ public class EndpointGatingTests
Assert.Equal(StatusCodes.Status503ServiceUnavailable, status.StatusCode);
}
/// <summary>Verifies that an active node passes the gate and runs the handler.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task ActiveNode_PassesGate_RunsHandler()
{
@@ -72,6 +76,8 @@ public class EndpointGatingTests
Assert.True(handlerRan());
}
/// <summary>Verifies that the handler runs when no gate is registered.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task NoGateRegistered_PassesGate_RunsHandler()
{
@@ -85,8 +91,10 @@ public class EndpointGatingTests
Assert.True(handlerRan());
}
// --- InboundAPI-006: request body size must be capped ---
// --- Request body size must be capped ---
/// <summary>Verifies that an oversized body short-circuits with a 413 and does not run the handler.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task OversizedBody_ShortCircuitsWith413_AndDoesNotRunHandler()
{
@@ -102,6 +110,8 @@ public class EndpointGatingTests
Assert.Equal(StatusCodes.Status413PayloadTooLarge, status.StatusCode);
}
/// <summary>Verifies that a body exactly at the limit runs the handler.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task BodyAtLimit_RunsHandler()
{
@@ -115,6 +125,8 @@ public class EndpointGatingTests
Assert.True(handlerRan());
}
/// <summary>Verifies that the filter caps the max request body size feature.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task FilterCapsMaxRequestBodySizeFeature()
{
@@ -135,18 +147,25 @@ public class EndpointGatingTests
private sealed class StubActiveNodeGate : IActiveNodeGate
{
private readonly bool _isActive;
/// <summary>Initializes the gate with a fixed active-node answer.</summary>
/// <param name="isActive">Whether this node reports itself as active.</param>
public StubActiveNodeGate(bool isActive) => _isActive = isActive;
/// <inheritdoc />
public bool IsActiveNode => _isActive;
}
private sealed class StubMaxBodySizeFeature : IHttpMaxRequestBodySizeFeature
{
/// <summary>Gets a value indicating the feature is writable (always false).</summary>
public bool IsReadOnly => false;
/// <summary>Gets or sets the maximum request body size in bytes.</summary>
public long? MaxRequestBodySize { get; set; }
}
// --- InboundAPI hot-reload: options must be re-read per request, not cached at ctor time ---
/// <summary>Verifies that the body size cap hot-reloads without a restart.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task BodySizeCap_HotReloads_WithoutRestart()
{
@@ -172,9 +191,18 @@ public class EndpointGatingTests
private sealed class TestOptionsMonitor<T> : IOptionsMonitor<T>
{
/// <summary>Initializes the monitor with a fixed current value.</summary>
/// <param name="currentValue">The value returned by the monitor.</param>
public TestOptionsMonitor(T currentValue) => CurrentValue = currentValue;
/// <summary>Gets the fixed options instance.</summary>
public T CurrentValue { get; set; }
/// <summary>Returns the fixed options instance regardless of name.</summary>
/// <param name="name">The named-options key, ignored.</param>
/// <returns>The fixed options instance.</returns>
public T Get(string? name) => CurrentValue;
/// <summary>Does nothing; the fake never raises change notifications.</summary>
/// <param name="listener">The change listener, ignored.</param>
/// <returns>Always null.</returns>
public IDisposable? OnChange(Action<T, string?> listener) => null;
}
}