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:
+16
-1
@@ -20,13 +20,16 @@ public class ScriptArtifactChangeSubscriberTests
|
||||
private sealed class RecordingBus : IScriptArtifactChangeBus
|
||||
{
|
||||
private readonly List<Action<ScriptArtifactsChanged>> _handlers = new();
|
||||
/// <summary>Gets the number of currently registered handlers.</summary>
|
||||
public int SubscriberCount => _handlers.Count;
|
||||
|
||||
/// <inheritdoc />
|
||||
public void Publish(ScriptArtifactsChanged notification)
|
||||
{
|
||||
foreach (var handler in _handlers.ToArray()) handler(notification);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public IDisposable Subscribe(Action<ScriptArtifactsChanged> handler)
|
||||
{
|
||||
_handlers.Add(handler);
|
||||
@@ -35,6 +38,7 @@ public class ScriptArtifactChangeSubscriberTests
|
||||
|
||||
private sealed class Token(Action dispose) : IDisposable
|
||||
{
|
||||
/// <summary>Releases the resources used by this instance.</summary>
|
||||
public void Dispose() => dispose();
|
||||
}
|
||||
}
|
||||
@@ -55,6 +59,8 @@ public class ScriptArtifactChangeSubscriberTests
|
||||
private static ScriptArtifactsChanged ApiMethodChanged(params string[] names) =>
|
||||
new(ScriptArtifactKinds.ApiMethod, names, "BundleImport", DateTimeOffset.UtcNow);
|
||||
|
||||
/// <summary>Verifies that an ApiMethod publish invalidates the cached handler without waiting for the revision-check self-heal.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task ApiMethodPublish_InvalidatesCachedHandler_WithoutRevisionCheckSelfHeal()
|
||||
{
|
||||
@@ -77,6 +83,8 @@ public class ScriptArtifactChangeSubscriberTests
|
||||
Assert.Contains("1", after.ResultJson); // recompiled from the fresh row — invalidation, not self-heal
|
||||
}
|
||||
|
||||
/// <summary>Verifies that an ApiMethod publish purges the known-bad record.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task ApiMethodPublish_PurgesKnownBadRecord()
|
||||
{
|
||||
@@ -92,6 +100,8 @@ public class ScriptArtifactChangeSubscriberTests
|
||||
Assert.Equal(0, _executor.KnownBadMethodCount);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that non-ApiMethod artifact kinds are ignored.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task NonApiMethodKinds_AreIgnored()
|
||||
{
|
||||
@@ -110,6 +120,8 @@ public class ScriptArtifactChangeSubscriberTests
|
||||
Assert.Contains("99", result.ResultJson); // pinned handler untouched
|
||||
}
|
||||
|
||||
/// <summary>Verifies that stopping the subscriber unsubscribes it from the bus.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task StopAsync_Unsubscribes()
|
||||
{
|
||||
@@ -123,10 +135,11 @@ public class ScriptArtifactChangeSubscriberTests
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// WP2.6b: an ApiMethod change notification must also drop the resolved-row cache
|
||||
/// An ApiMethod change notification must also drop the resolved-row cache
|
||||
/// entry (not just the compiled handler) — proving EndpointExtensions' next lookup
|
||||
/// re-fetches instead of serving a stale cached row for the rest of the TTL window.
|
||||
/// </summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task ApiMethodPublish_InvalidatesResolvedMethodCache()
|
||||
{
|
||||
@@ -150,6 +163,8 @@ public class ScriptArtifactChangeSubscriberTests
|
||||
Assert.Equal(2, fetchCount); // cache entry was dropped — re-fetched
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a null bus is tolerated and the subscriber does nothing.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task NullBus_NoOps()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user