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
@@ -5,7 +5,7 @@ using ZB.MOM.WW.ScadaBridge.TestSupport;
namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests.Persistence;
/// <summary>
/// Task 14: site-local SQLite <c>native_alarm_state</c> store — mirrored native alarm
/// Site-local SQLite <c>native_alarm_state</c> store — mirrored native alarm
/// condition snapshots keyed by (instance, source canonical name, source reference).
/// </summary>
/// <remarks>
@@ -17,19 +17,26 @@ public class NativeAlarmStateStoreTests : IAsyncLifetime, IDisposable
private readonly TestLocalDb _localDb;
private SiteStorageService _storage = null!;
/// <summary>Initializes the tests with a temporary local database.</summary>
public NativeAlarmStateStoreTests()
{
_localDb = TestLocalDb.CreateTemp("nas");
}
/// <summary>Prepares the test fixture before the first test runs.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
public async Task InitializeAsync()
{
_storage = new SiteStorageService(_localDb.Db, NullLogger<SiteStorageService>.Instance);
await _storage.InitializeAsync();
}
/// <summary>Does nothing; cleanup happens in <c>Dispose</c>.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
public Task DisposeAsync() => Task.CompletedTask;
/// <summary>Verifies that an upserted alarm row can be read back unchanged.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task Upsert_Then_Get_RoundTrips()
{
@@ -43,6 +50,8 @@ public class NativeAlarmStateStoreTests : IAsyncLifetime, IDisposable
Assert.Equal(DateTimeOffset.UnixEpoch, rows[0].LastTransitionAt);
}
/// <summary>Verifies that upserting the same key replaces the condition and timestamp.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task Upsert_SameKey_ReplacesConditionAndTimestamp()
{
@@ -56,6 +65,8 @@ public class NativeAlarmStateStoreTests : IAsyncLifetime, IDisposable
Assert.Equal(DateTimeOffset.UnixEpoch.AddMinutes(5), rows[0].LastTransitionAt);
}
/// <summary>Verifies that a read is scoped to the instance and source canonical name.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task Get_ScopesToInstanceAndSourceCanonicalName()
{
@@ -69,6 +80,8 @@ public class NativeAlarmStateStoreTests : IAsyncLifetime, IDisposable
Assert.Equal("Tank01.Hi", rows[0].SourceReference);
}
/// <summary>Verifies that deleting removes only the single targeted row.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task Delete_RemovesSingleRow()
{
@@ -82,6 +95,8 @@ public class NativeAlarmStateStoreTests : IAsyncLifetime, IDisposable
Assert.Equal("Tank01.Lo", rows[0].SourceReference);
}
/// <summary>Verifies that clearing an instance removes all of its sources and leaves other instances untouched.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task ClearForInstance_RemovesAllSourcesForInstanceOnly()
{
@@ -96,6 +111,7 @@ public class NativeAlarmStateStoreTests : IAsyncLifetime, IDisposable
Assert.Single(await _storage.GetNativeAlarmsAsync("other", "SrcA"));
}
/// <summary>Releases the resources held by this instance.</summary>
public void Dispose()
{
// Dispose first — the master connection anchors the WAL, so the sidecars