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:
@@ -17,8 +17,11 @@ namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests;
|
||||
/// </summary>
|
||||
public class ConcurrencyTestDbContext : ScadaBridgeDbContext
|
||||
{
|
||||
/// <summary>Initializes the context with the given options.</summary>
|
||||
/// <param name="options">The context options.</param>
|
||||
public ConcurrencyTestDbContext(DbContextOptions<ScadaBridgeDbContext> options) : base(options) { }
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
base.OnModelCreating(modelBuilder);
|
||||
@@ -41,13 +44,16 @@ public class ConcurrencyTestDbContext : ScadaBridgeDbContext
|
||||
/// A SQLite-friendly DbContext that keeps <see cref="DeploymentRecord.RowVersion"/> as
|
||||
/// the optimistic-concurrency token but disables auto-generation (SQLite cannot
|
||||
/// auto-populate a rowversion column). The caller sets RowVersion explicitly, which
|
||||
/// is sufficient to exercise the production stub-attach delete path under CD-017's
|
||||
/// is sufficient to exercise the production stub-attach delete path under the
|
||||
/// concurrency rule.
|
||||
/// </summary>
|
||||
public class RowVersionConcurrencyTestDbContext : ScadaBridgeDbContext
|
||||
{
|
||||
/// <summary>Initializes the context with the given options.</summary>
|
||||
/// <param name="options">The context options.</param>
|
||||
public RowVersionConcurrencyTestDbContext(DbContextOptions<ScadaBridgeDbContext> options) : base(options) { }
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
base.OnModelCreating(modelBuilder);
|
||||
@@ -66,11 +72,13 @@ public class ConcurrencyTests : IDisposable
|
||||
{
|
||||
private readonly string _dbPath;
|
||||
|
||||
/// <summary>Creates a unique temporary SQLite database path for each test.</summary>
|
||||
public ConcurrencyTests()
|
||||
{
|
||||
_dbPath = Path.Combine(Path.GetTempPath(), $"scadabridge_test_{Guid.NewGuid()}.db");
|
||||
}
|
||||
|
||||
/// <summary>Releases the resources held by this test class.</summary>
|
||||
public void Dispose()
|
||||
{
|
||||
if (File.Exists(_dbPath))
|
||||
@@ -86,6 +94,8 @@ public class ConcurrencyTests : IDisposable
|
||||
return new ConcurrencyTestDbContext(options);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a second update of a deployment record from a stale copy throws a concurrency exception.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task DeploymentRecord_OptimisticConcurrency_SecondUpdateThrows()
|
||||
{
|
||||
@@ -138,6 +148,8 @@ public class ConcurrencyTests : IDisposable
|
||||
() => ctx2.SaveChangesAsync());
|
||||
}
|
||||
|
||||
/// <summary>Verifies that templates have no optimistic concurrency, so the last write wins.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task Template_NoOptimisticConcurrency_LastWriteWins()
|
||||
{
|
||||
@@ -175,10 +187,12 @@ public class ConcurrencyTests : IDisposable
|
||||
Assert.Equal("Second update", loaded.Description);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that deleting a deployment record with a stale row version throws a concurrency exception.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task DeleteDeploymentRecord_StaleRowVersion_ThrowsConcurrencyException()
|
||||
{
|
||||
// CD-017: Verifies the stub-attach delete path enforces optimistic concurrency
|
||||
// Verifies the stub-attach delete path enforces optimistic concurrency
|
||||
// when the caller passes a RowVersion that no longer matches the row's current
|
||||
// RowVersion. Uses a SQLite fixture where DeploymentRecord.RowVersion is an
|
||||
// explicit, caller-managed concurrency token (no SQL Server auto-generation).
|
||||
@@ -232,6 +246,7 @@ public class ConcurrencyTests : IDisposable
|
||||
.Options;
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the <c>DeploymentRecord</c> row version is configured as a concurrency token.</summary>
|
||||
[Fact]
|
||||
public void DeploymentRecord_HasRowVersionConfigured()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user