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
@@ -19,12 +19,14 @@ public class PendingDeploymentRepositoryTests : IDisposable
private readonly ScadaBridgeDbContext _context;
private readonly DeploymentManagerRepository _repository;
/// <summary>Initializes the test class with an in-memory context and repository.</summary>
public PendingDeploymentRepositoryTests()
{
_context = SqliteTestHelper.CreateInMemoryContext();
_repository = new DeploymentManagerRepository(_context);
}
/// <summary>Releases the resources held by this test class.</summary>
public void Dispose()
{
_context.Database.CloseConnection();
@@ -58,6 +60,8 @@ public class PendingDeploymentRepositoryTests : IDisposable
createdAtUtc: now, expiresAtUtc: now.AddMinutes(10));
}
/// <summary>Verifies that a second pending deployment for the same instance supersedes the prior row.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task AddPendingDeployment_SecondDeployForSameInstance_SupersedesPriorRow()
{
@@ -78,6 +82,8 @@ public class PendingDeploymentRepositoryTests : IDisposable
Assert.Equal(instanceId, current.InstanceId);
}
/// <summary>Verifies that pending deployments for different instances coexist.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task AddPendingDeployment_DifferentInstances_Coexist()
{
@@ -96,6 +102,8 @@ public class PendingDeploymentRepositoryTests : IDisposable
Assert.Equal(instance2, b!.InstanceId);
}
/// <summary>Verifies that purging expired pending deployments removes only the expired rows and returns the count.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task PurgeExpiredPendingDeployments_RemovesOnlyExpired_ReturnsCount()
{
@@ -123,6 +131,8 @@ public class PendingDeploymentRepositoryTests : IDisposable
Assert.NotNull(await _repository.GetPendingDeploymentByIdAsync("live-1"));
}
/// <summary>Verifies that purging expired pending deployments returns zero when none are expired.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task PurgeExpiredPendingDeployments_NoneExpired_ReturnsZero()
{
@@ -138,6 +148,8 @@ public class PendingDeploymentRepositoryTests : IDisposable
Assert.NotNull(await _repository.GetPendingDeploymentByIdAsync("live-1"));
}
/// <summary>Verifies that deleting a pending deployment by id removes the row.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task DeletePendingDeploymentById_RemovesRow()
{
@@ -151,6 +163,8 @@ public class PendingDeploymentRepositoryTests : IDisposable
Assert.Null(await _repository.GetPendingDeploymentByIdAsync("dep1"));
}
/// <summary>Verifies that deleting a pending deployment with an unknown id does not throw.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task DeletePendingDeploymentById_UnknownId_NoThrow()
{
@@ -159,6 +173,8 @@ public class PendingDeploymentRepositoryTests : IDisposable
Assert.Null(await _repository.GetPendingDeploymentByIdAsync("does-not-exist"));
}
/// <summary>Verifies that getting a pending deployment by instance id returns the row when present.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task GetPendingDeploymentByInstanceId_ReturnsRow_WhenPresent()
{
@@ -178,6 +194,8 @@ public class PendingDeploymentRepositoryTests : IDisposable
Assert.Equal("{\"v\":9}", row.ConfigurationJson);
}
/// <summary>Verifies that getting a pending deployment by instance id returns null when absent.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task GetPendingDeploymentByInstanceId_ReturnsNull_WhenAbsent()
{
@@ -189,6 +207,8 @@ public class PendingDeploymentRepositoryTests : IDisposable
Assert.Null(row);
}
/// <summary>Verifies that staging is not blocked by an expired row with a different deployment id, which is removed and replaced by the live row.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task StagePendingIfAbsent_ExpiredRowDifferentDeploymentId_DoesNotBlock_RemovesExpiredAndStagesLiveRow()
{
@@ -219,6 +239,8 @@ public class PendingDeploymentRepositoryTests : IDisposable
Assert.True(row.ExpiresAtUtc > now); // the new row is live
}
/// <summary>Verifies that staging over an expired row with the same deployment id causes no unique-key collision and stages the new row.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task StagePendingIfAbsent_ExpiredRowSameDeploymentId_NoUniqueCollision_StagesNew()
{
@@ -245,6 +267,8 @@ public class PendingDeploymentRepositoryTests : IDisposable
Assert.True(row.ExpiresAtUtc > now);
}
/// <summary>Verifies that a live row blocks staging and is left untouched.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task StagePendingIfAbsent_LiveRow_Blocks_LeavesUntouched()
{
@@ -269,6 +293,8 @@ public class PendingDeploymentRepositoryTests : IDisposable
Assert.Null(await _repository.GetPendingDeploymentByIdAsync("dep-new"));
}
/// <summary>Verifies that getting a pending deployment by instance id with an explicit current time returns the live, unexpired row.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task GetPendingDeploymentByInstanceId_WithNowUtc_ReturnsLiveRow_NotExpired()
{
@@ -294,6 +320,8 @@ public class PendingDeploymentRepositoryTests : IDisposable
Assert.Equal("dep-getlive", live!.DeploymentId);
}
/// <summary>Verifies that adding a pending deployment supersedes all prior rows for the same instance.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task AddPendingDeployment_MultiplePriorRowsSameInstance_AllSuperseded()
{