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
@@ -36,12 +36,14 @@ public class DeploymentListQueryRepositoryTests : IDisposable
private readonly DeploymentManagerRepository _repository;
private readonly DateTimeOffset _base = new(2026, 8, 15, 12, 0, 0, TimeSpan.Zero);
/// <summary>Initializes a new instance of the <c>DeploymentListQueryRepositoryTests</c> class.</summary>
public DeploymentListQueryRepositoryTests()
{
_context = SqliteTestHelper.CreateInMemoryContext();
_repository = new DeploymentManagerRepository(_context);
}
/// <summary>Releases the resources held by the test fixture.</summary>
public void Dispose()
{
_context.Database.CloseConnection();
@@ -91,6 +93,8 @@ public class DeploymentListQueryRepositoryTests : IDisposable
// ── Paging ────────────────────────────────────────────────────────────────
/// <summary>Verifies that a page query returns the requested slice together with the total count of the whole set.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task QueryPage_ReturnsRequestedSlice_AndTheTotalCountOfTheWholeSet()
{
@@ -108,11 +112,13 @@ public class DeploymentListQueryRepositoryTests : IDisposable
Assert.Equal(10, page2.Rows.Count);
Assert.Equal(3, page2.PageCount(10));
// Newest first: page 2 of 10 starts at the 11th newest, dep-014.
// Newest first: page 2 of 10 starts at the 11th newest deployment.
Assert.Equal("dep-014", page2.Rows[0].DeploymentId);
Assert.Equal("dep-005", page2.Rows[^1].DeploymentId);
}
/// <summary>Verifies that consecutive pages neither overlap nor drop rows, even when rows share a deployed-at timestamp.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task QueryPage_PagesDoNotOverlapOrDropRows_EvenWhenDeployedAtTies()
{
@@ -138,6 +144,8 @@ public class DeploymentListQueryRepositoryTests : IDisposable
Assert.Equal(9, seen.Distinct().Count());
}
/// <summary>Verifies that a non-positive page number is floored at page one.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task QueryPage_NonPositivePageNumber_IsFlooredAtPageOne()
{
@@ -151,6 +159,8 @@ public class DeploymentListQueryRepositoryTests : IDisposable
Assert.Single(page.Rows);
}
/// <summary>Verifies that an oversized page size is clamped to the maximum.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task QueryPage_OversizedPageSize_IsClampedToTheMaximum()
{
@@ -167,6 +177,8 @@ public class DeploymentListQueryRepositoryTests : IDisposable
Assert.True(DeploymentListPage.MaxPageSize > 0);
}
/// <summary>Verifies that a page past the end returns no rows but still reports the total.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task QueryPage_PastTheEnd_ReturnsNoRowsButStillReportsTheTotal()
{
@@ -183,6 +195,8 @@ public class DeploymentListQueryRepositoryTests : IDisposable
// ── Joined projection ─────────────────────────────────────────────────────
/// <summary>Verifies that the page query joins the instance so its name and site travel with each row.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task QueryPage_JoinsTheInstance_SoNameAndSiteTravelWithTheRow()
{
@@ -205,6 +219,8 @@ public class DeploymentListQueryRepositoryTests : IDisposable
// ── Filters ───────────────────────────────────────────────────────────────
/// <summary>Verifies that the status filter is applied in the database query.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task QueryPage_StatusFilter_IsAppliedInTheDatabase()
{
@@ -220,6 +236,8 @@ public class DeploymentListQueryRepositoryTests : IDisposable
Assert.Equal("dep-bad", Assert.Single(page.Rows).DeploymentId);
}
/// <summary>Verifies that the instance filter restricts results to a single instance's history.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task QueryPage_InstanceFilter_RestrictsToOneInstanceHistory()
{
@@ -235,6 +253,10 @@ public class DeploymentListQueryRepositoryTests : IDisposable
Assert.Equal("dep-b", Assert.Single(page.Rows).DeploymentId);
}
/// <summary>Verifies that the search term matches across the identifiers a user can look up.</summary>
/// <param name="term">The term.</param>
/// <param name="expected">The expected.</param>
/// <returns>A task that represents the asynchronous operation.</returns>
[Theory]
[InlineData("Filler", "dep-a")] // instance unique name
[InlineData("dep-b", "dep-b")] // deployment id
@@ -254,6 +276,8 @@ public class DeploymentListQueryRepositoryTests : IDisposable
Assert.Equal(expected, Assert.Single(page.Rows).DeploymentId);
}
/// <summary>Verifies that a whitespace-only search is treated as no constraint.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task QueryPage_WhitespaceSearch_IsTreatedAsUnconstrained()
{
@@ -267,6 +291,8 @@ public class DeploymentListQueryRepositoryTests : IDisposable
Assert.Equal(1, page.TotalCount);
}
/// <summary>Verifies that the site scope restricts results to the granted sites.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task QueryPage_SiteScope_RestrictsToTheGrantedSites()
{
@@ -284,6 +310,8 @@ public class DeploymentListQueryRepositoryTests : IDisposable
Assert.Equal("dep-b", Assert.Single(page.Rows).DeploymentId);
}
/// <summary>Verifies that an empty site scope is a real filter that matches nothing.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task QueryPage_EmptySiteScope_IsARealFilterThatMatchesNothing()
{
@@ -300,6 +328,8 @@ public class DeploymentListQueryRepositoryTests : IDisposable
Assert.Empty(page.Rows);
}
/// <summary>Verifies that site scope and status filters compose correctly for the CLI query path.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task QueryPage_SiteScopeAndStatus_Compose_ForTheCliQueryPath()
{
@@ -333,6 +363,8 @@ public class DeploymentListQueryRepositoryTests : IDisposable
// ── Status counts ─────────────────────────────────────────────────────────
/// <summary>Verifies that status counts group every status and report absent statuses as zero.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task StatusCounts_GroupsEveryStatus_WithAbsentOnesReportedAsZero()
{
@@ -352,6 +384,8 @@ public class DeploymentListQueryRepositoryTests : IDisposable
Assert.Equal(4, counts.Total);
}
/// <summary>Verifies that status counts ignore the status filter so each tile keeps its own total.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task StatusCounts_IgnoreTheStatusFilter_SoEachTileKeepsItsOwnTotal()
{
@@ -371,6 +405,8 @@ public class DeploymentListQueryRepositoryTests : IDisposable
Assert.Equal(2, counts.Total);
}
/// <summary>Verifies that status counts honor every filter dimension other than status.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task StatusCounts_HonourEveryOtherFilterDimension()
{
@@ -396,6 +432,8 @@ public class DeploymentListQueryRepositoryTests : IDisposable
Assert.Equal(2, byInstance.Total);
}
/// <summary>Verifies that status counts over an empty set are all zero.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task StatusCounts_EmptySet_IsAllZeros()
{