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
@@ -20,7 +20,7 @@ using ZB.MOM.WW.ScadaBridge.StoreAndForward;
namespace ZB.MOM.WW.ScadaBridge.Host.Tests;
/// <summary>
/// Bundle E (M2 Task E1) — verifies the Audit Log (#23) DI surface is wired
/// Verifies the Audit Log DI surface is wired
/// into both composition roots and that the HOCON document emitted by
/// <see cref="AkkaHostedService.BuildHocon"/> includes the dedicated
/// <c>audit-telemetry-dispatcher</c> the site telemetry actor binds to.
@@ -36,6 +36,7 @@ namespace ZB.MOM.WW.ScadaBridge.Host.Tests;
/// </remarks>
public class AkkaHostedServiceAuditWiringHoconTests
{
/// <summary>Verifies that the generated HOCON contains the audit telemetry dispatcher block.</summary>
[Fact]
public void BuildHocon_Emits_AuditTelemetryDispatcher_Block()
{
@@ -84,7 +85,7 @@ public class AkkaHostedServiceAuditWiringHoconTests
}
/// <summary>
/// Verifies Audit Log (#23) services land in the Central composition root.
/// Verifies Audit Log services land in the Central composition root.
/// </summary>
[Collection(HostBootCollection.Name)]
public class CentralAuditWiringTests : IDisposable
@@ -93,6 +94,7 @@ public class CentralAuditWiringTests : IDisposable
private readonly string? _previousEnv;
private readonly CentralDbTestEnvironment _dbEnv;
/// <summary>Initializes the Central composition root host used by the tests.</summary>
public CentralAuditWiringTests()
{
_previousEnv = Environment.GetEnvironmentVariable("DOTNET_ENVIRONMENT");
@@ -119,7 +121,7 @@ public class CentralAuditWiringTests : IDisposable
["ScadaBridge:Cluster:SeedNodes:1"] = "akka.tcp://scadabridge@localhost:2552",
["ScadaBridge:Database:SkipMigrations"] = "true",
["ScadaBridge:Security:JwtSigningKey"] = "test-signing-key-must-be-at-least-32-chars-long!",
// Task 1.4: LDAP settings nest under Security:Ldap (shared LdapOptions).
// LDAP settings nest under Security:Ldap (shared LdapOptions).
// ServiceAccountDn is now required by the library's LdapOptionsValidator
// (ValidateOnStart), so it must be present for the host to start.
["ScadaBridge:Security:Ldap:Server"] = "localhost",
@@ -155,6 +157,7 @@ public class CentralAuditWiringTests : IDisposable
_ = _factory.Server;
}
/// <summary>Releases the resources held by the test fixture.</summary>
public void Dispose()
{
// try/finally: a throwing host teardown must not strand the process-wide
@@ -170,6 +173,7 @@ public class CentralAuditWiringTests : IDisposable
}
}
/// <summary>Verifies that the Central composition root resolves the audit writer as the fallback audit writer.</summary>
[Fact]
public void Central_Resolves_IAuditWriter_AsFallbackAuditWriter()
{
@@ -183,6 +187,7 @@ public class CentralAuditWiringTests : IDisposable
Assert.IsType<FallbackAuditWriter>(writer);
}
/// <summary>Verifies that the Central composition root resolves the audit log options.</summary>
[Fact]
public void Central_Resolves_AuditLogOptions()
{
@@ -191,6 +196,7 @@ public class CentralAuditWiringTests : IDisposable
Assert.NotNull(opts!.Value);
}
/// <summary>Verifies that the Central composition root resolves the SQLite audit writer options.</summary>
[Fact]
public void Central_Resolves_SqliteAuditWriterOptions()
{
@@ -199,6 +205,7 @@ public class CentralAuditWiringTests : IDisposable
Assert.NotNull(opts!.Value);
}
/// <summary>Verifies that the Central composition root resolves the site audit telemetry options.</summary>
[Fact]
public void Central_Resolves_SiteAuditTelemetryOptions()
{
@@ -207,6 +214,7 @@ public class CentralAuditWiringTests : IDisposable
Assert.NotNull(opts!.Value);
}
/// <summary>Verifies that the Central composition root resolves the site stream audit client as the no-op default.</summary>
[Fact]
public void Central_Resolves_ISiteStreamAuditClient_AsNoOpDefault()
{
@@ -216,7 +224,7 @@ public class CentralAuditWiringTests : IDisposable
}
/// <summary>
/// M3 Bundle F (T15): the Central composition root calls
/// The Central composition root calls
/// <c>AddSiteCallAudit()</c>. Today that extension is a no-op placeholder,
/// but invoking it must not throw and the central host's service collection
/// must build successfully — the actor's Props are constructed inline in
@@ -236,10 +244,10 @@ public class CentralAuditWiringTests : IDisposable
}
/// <summary>
/// M3 Bundle F: the Central composition root registers
/// The Central composition root registers
/// <c>ICachedCallTelemetryForwarder</c> as a lazy singleton (the
/// forwarder degrades to audit-only emission when the site-only
/// <c>IOperationTrackingStore</c> is absent, matching the M2 lazy chain
/// <c>IOperationTrackingStore</c> is absent, matching the lazy chain
/// pattern). The binding is exercised here so a future regression that
/// removes the registration or makes IOperationTrackingStore mandatory
/// fails on the Central node, not just at first script execution.
@@ -284,7 +292,7 @@ public class CentralAuditWiringTests : IDisposable
}
/// <summary>
/// Verifies Audit Log (#23) services land in the Site composition root.
/// Verifies Audit Log services land in the Site composition root.
/// </summary>
public class SiteAuditWiringTests : IDisposable
{
@@ -292,6 +300,7 @@ public class SiteAuditWiringTests : IDisposable
private readonly string _tempDbPath;
private readonly string _tempLocalDbPath;
/// <summary>Initializes the Site composition root host used by the tests.</summary>
public SiteAuditWiringTests()
{
_tempDbPath = Path.Combine(Path.GetTempPath(), $"scadabridge_audit_wiring_{Guid.NewGuid()}.db");
@@ -329,6 +338,7 @@ public class SiteAuditWiringTests : IDisposable
_host = builder.Build();
}
/// <summary>Releases the resources held by the test fixture.</summary>
public void Dispose()
{
(_host as IDisposable)?.Dispose();
@@ -336,6 +346,7 @@ public class SiteAuditWiringTests : IDisposable
try { File.Delete(_tempLocalDbPath); } catch { /* best effort */ }
}
/// <summary>Verifies that the Site composition root resolves the audit writer as the fallback audit writer.</summary>
[Fact]
public void Site_Resolves_IAuditWriter_AsFallbackAuditWriter()
{
@@ -344,6 +355,7 @@ public class SiteAuditWiringTests : IDisposable
Assert.IsType<FallbackAuditWriter>(writer);
}
/// <summary>Verifies that the Site composition root resolves the SQLite audit writer as a singleton.</summary>
[Fact]
public void Site_Resolves_SqliteAuditWriter_AsSingleton()
{
@@ -354,6 +366,7 @@ public class SiteAuditWiringTests : IDisposable
Assert.Same(a, b);
}
/// <summary>Verifies that the site audit queue and the SQLite audit writer resolve to the same instance.</summary>
[Fact]
public void Site_ISiteAuditQueue_AndSqliteAuditWriter_AreSameInstance()
{
@@ -367,6 +380,7 @@ public class SiteAuditWiringTests : IDisposable
Assert.Same(writer, queue);
}
/// <summary>Verifies that the Site composition root resolves the ring buffer fallback.</summary>
[Fact]
public void Site_Resolves_RingBufferFallback()
{
@@ -374,10 +388,11 @@ public class SiteAuditWiringTests : IDisposable
Assert.NotNull(ring);
}
/// <summary>Verifies that the Site composition root resolves the audit write failure counter as the health metrics bridge.</summary>
[Fact]
public void Site_Resolves_IAuditWriteFailureCounter_AsHealthMetricsBridge()
{
// Bundle G (M2-T11): site composition root calls
// The site composition root calls
// AddAuditLogHealthMetricsBridge() after AddAuditLog + AddSiteHealthMonitoring,
// which swaps the NoOp default for the real health-metrics bridge so
// FallbackAuditWriter primary failures surface in the site health
@@ -387,6 +402,7 @@ public class SiteAuditWiringTests : IDisposable
Assert.IsType<HealthMetricsAuditWriteFailureCounter>(counter);
}
/// <summary>Verifies that the Site composition root resolves the site stream audit client as the no-op default.</summary>
[Fact]
public void Site_Resolves_ISiteStreamAuditClient_AsNoOpDefault()
{
@@ -395,6 +411,7 @@ public class SiteAuditWiringTests : IDisposable
Assert.IsType<NoOpSiteStreamAuditClient>(client);
}
/// <summary>Verifies that the Site composition root resolves the site audit telemetry options with their default values.</summary>
[Fact]
public void Site_Resolves_SiteAuditTelemetryOptions_WithDefaults()
{
@@ -406,12 +423,12 @@ public class SiteAuditWiringTests : IDisposable
}
/// <summary>
/// M3 Bundle F (T15): the site composition root resolves the cached-call
/// The site composition root resolves the cached-call
/// telemetry forwarder. ScriptExecutionActor consumes this through
/// <c>GetService&lt;ICachedCallTelemetryForwarder&gt;()</c> on every script
/// execution; a missing registration would silently degrade
/// <c>ExternalSystem.CachedCall</c> / <c>Database.CachedWrite</c> to the
/// "no-emission" path and break the M3 audit pipeline.
/// "no-emission" path and break the cached-call audit pipeline.
/// </summary>
[Fact]
public void Site_Resolves_ICachedCallTelemetryForwarder()
@@ -422,7 +439,7 @@ public class SiteAuditWiringTests : IDisposable
}
/// <summary>
/// M3 Bundle F (T15): the site composition root resolves the lifecycle
/// The site composition root resolves the lifecycle
/// bridge that translates S&amp;F retry-loop attempt notifications into
/// cached-call telemetry packets.
/// </summary>
@@ -437,7 +454,7 @@ public class SiteAuditWiringTests : IDisposable
}
/// <summary>
/// M3 Bundle F (T15): the lifecycle bridge is bound to the
/// The lifecycle bridge is bound to the
/// <see cref="ICachedCallLifecycleObserver"/> contract that
/// StoreAndForwardService consults at construction time. Without this
/// binding the S&amp;F service is built with a null observer and the
@@ -454,7 +471,7 @@ public class SiteAuditWiringTests : IDisposable
}
/// <summary>
/// M3 Bundle F (T15): the Host registers an
/// The Host registers an
/// <see cref="IStoreAndForwardSiteContext"/> adapter so the S&amp;F service
/// can resolve the site id at composition time WITHOUT introducing a
/// StoreAndForward → HealthMonitoring project-reference cycle.