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:
+29
-3
@@ -8,8 +8,8 @@ using Xunit;
|
||||
namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests;
|
||||
|
||||
/// <summary>
|
||||
/// Integration tests for <see cref="SecuredWriteRepository"/> (M7 OPC UA / MxGateway
|
||||
/// UX, Task T14b). Uses the same <see cref="MsSqlMigrationFixture"/> as the migration
|
||||
/// Integration tests for <see cref="SecuredWriteRepository"/> (OPC UA / MxGateway
|
||||
/// secured writes). Uses the same <see cref="MsSqlMigrationFixture"/> as the migration
|
||||
/// tests so the EF reads/writes execute against the real <c>PendingSecuredWrites</c>
|
||||
/// schema produced by the migration. Each test mints a fresh per-test
|
||||
/// <c>SiteId</c>/<c>Status</c> suffix so tests neither collide nor require teardown.
|
||||
@@ -20,11 +20,15 @@ public class SecuredWriteRepositoryTests : IClassFixture<MsSqlMigrationFixture>
|
||||
{
|
||||
private readonly MsSqlMigrationFixture _fixture;
|
||||
|
||||
/// <summary>Initializes the suite with the shared MS SQL migration fixture.</summary>
|
||||
/// <param name="fixture">The shared MS SQL migration fixture.</param>
|
||||
public SecuredWriteRepositoryTests(MsSqlMigrationFixture fixture)
|
||||
{
|
||||
_fixture = fixture;
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a pending secured write round-trips through add, get, update and query.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[SkippableFact]
|
||||
public async Task Lifecycle_AddGetUpdateQuery_RoundTrips()
|
||||
{
|
||||
@@ -92,6 +96,8 @@ public class SecuredWriteRepositoryTests : IClassFixture<MsSqlMigrationFixture>
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Verifies that null filters match every status for the site.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[SkippableFact]
|
||||
public async Task QueryAsync_NullFilters_MatchEveryStatusForSite()
|
||||
{
|
||||
@@ -109,6 +115,8 @@ public class SecuredWriteRepositoryTests : IClassFixture<MsSqlMigrationFixture>
|
||||
Assert.Contains(all, p => p.Id == executedId);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a pending row flips to expired exactly once.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[SkippableFact]
|
||||
public async Task TryMarkExpiredAsync_PendingRow_FlipsToExpired_Once()
|
||||
{
|
||||
@@ -132,6 +140,8 @@ public class SecuredWriteRepositoryTests : IClassFixture<MsSqlMigrationFixture>
|
||||
Assert.Null(row.VerifierUser); // system decision, no verifier
|
||||
}
|
||||
|
||||
/// <summary>Verifies that marking an already decided row expired returns false.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[SkippableFact]
|
||||
public async Task TryMarkExpiredAsync_DecidedRow_ReturnsFalse()
|
||||
{
|
||||
@@ -148,6 +158,8 @@ public class SecuredWriteRepositoryTests : IClassFixture<MsSqlMigrationFixture>
|
||||
Assert.False(await repo.TryMarkExpiredAsync(id, DateTime.UtcNow));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a pending row flips to rejected exactly once.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[SkippableFact]
|
||||
public async Task TryMarkRejectedAsync_PendingRow_FlipsToRejected_Once()
|
||||
{
|
||||
@@ -177,10 +189,12 @@ public class SecuredWriteRepositoryTests : IClassFixture<MsSqlMigrationFixture>
|
||||
Assert.Null(row.ExecutionError);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that when an approve is followed by a reject on one pending row, the approve wins and the reject returns false.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[SkippableFact]
|
||||
public async Task ApproveThenReject_OnOnePendingRow_ApproveWins_RejectReturnsFalse()
|
||||
{
|
||||
// arch-review 2026-08-19 P6-1: approve and reject both transition out of Pending,
|
||||
// Approve and reject both transition out of Pending,
|
||||
// so exactly one may win. This is the ordering that used to falsify the
|
||||
// two-person-control record — a blind reject update landing after approve had
|
||||
// already committed (and, in production, while its multi-second site relay was
|
||||
@@ -205,6 +219,8 @@ public class SecuredWriteRepositoryTests : IClassFixture<MsSqlMigrationFixture>
|
||||
Assert.Equal("ok", row.VerifierComment);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that when a reject is followed by an approve on one pending row, the reject wins and the approve returns false.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[SkippableFact]
|
||||
public async Task RejectThenApprove_OnOnePendingRow_RejectWins_ApproveReturnsFalse()
|
||||
{
|
||||
@@ -229,6 +245,8 @@ public class SecuredWriteRepositoryTests : IClassFixture<MsSqlMigrationFixture>
|
||||
Assert.Equal("no", row.VerifierComment);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that rejecting an expired row returns false.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[SkippableFact]
|
||||
public async Task TryMarkRejectedAsync_ExpiredRow_ReturnsFalse()
|
||||
{
|
||||
@@ -250,6 +268,8 @@ public class SecuredWriteRepositoryTests : IClassFixture<MsSqlMigrationFixture>
|
||||
Assert.Null(row.VerifierUser);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the count applies the same filters as the query.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[SkippableFact]
|
||||
public async Task CountAsync_FiltersLikeQueryAsync()
|
||||
{
|
||||
@@ -266,6 +286,8 @@ public class SecuredWriteRepositoryTests : IClassFixture<MsSqlMigrationFixture>
|
||||
Assert.Equal(0, await repo.CountAsync(status: "Executed", siteId: siteId));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a query with permitted site ids returns only rows for those sites.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[SkippableFact]
|
||||
public async Task QueryAsync_PermittedSiteIds_ReturnsOnlyPermittedRows()
|
||||
{
|
||||
@@ -290,6 +312,8 @@ public class SecuredWriteRepositoryTests : IClassFixture<MsSqlMigrationFixture>
|
||||
Assert.DoesNotContain(rows, r => r.SiteId == site2);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a count with permitted site ids counts only rows for those sites.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[SkippableFact]
|
||||
public async Task CountAsync_PermittedSiteIds_CountsOnlyPermittedRows()
|
||||
{
|
||||
@@ -311,6 +335,8 @@ public class SecuredWriteRepositoryTests : IClassFixture<MsSqlMigrationFixture>
|
||||
Assert.Equal(3, count);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a null permitted-site list leaves the query unfiltered, for backward compatibility.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[SkippableFact]
|
||||
public async Task QueryAsync_NullPermittedSiteIds_IsUnfiltered_BackCompat()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user