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:
+18
-2
@@ -7,8 +7,8 @@ using Xunit;
|
||||
namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests;
|
||||
|
||||
/// <summary>
|
||||
/// Round-trip tests for <see cref="SharedSchemaRepository"/> (M9 template-level JSON-Schema
|
||||
/// library, Task T32a). Uses the in-memory SQLite harness (<see cref="SqliteTestHelper"/>)
|
||||
/// Round-trip tests for <see cref="SharedSchemaRepository"/> (template-level JSON-Schema
|
||||
/// library). Uses the in-memory SQLite harness (<see cref="SqliteTestHelper"/>)
|
||||
/// — the schema is materialized via <c>EnsureCreated()</c> from the same model the
|
||||
/// migration was generated from, so the tests run unconditionally (no live MSSQL needed)
|
||||
/// while still exercising the real unique-<c>Name</c> index. Mirrors the
|
||||
@@ -19,18 +19,22 @@ public class SharedSchemaRepositoryTests : IDisposable
|
||||
private readonly ScadaBridgeDbContext _context;
|
||||
private readonly SharedSchemaRepository _repository;
|
||||
|
||||
/// <summary>Initializes a new instance of <c>SharedSchemaRepositoryTests</c>.</summary>
|
||||
public SharedSchemaRepositoryTests()
|
||||
{
|
||||
_context = SqliteTestHelper.CreateInMemoryContext();
|
||||
_repository = new SharedSchemaRepository(_context);
|
||||
}
|
||||
|
||||
/// <summary>Releases the resources held by this test class.</summary>
|
||||
public void Dispose()
|
||||
{
|
||||
_context.Database.CloseConnection();
|
||||
_context.Dispose();
|
||||
}
|
||||
|
||||
/// <summary>Verifies that add then get by name round trips.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task Add_ThenGetByName_RoundTrips()
|
||||
{
|
||||
@@ -58,6 +62,8 @@ public class SharedSchemaRepositoryTests : IDisposable
|
||||
Assert.Equal("TankReading", byId!.Name);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that get by name unknown returns null.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task GetByName_Unknown_ReturnsNull()
|
||||
{
|
||||
@@ -65,6 +71,8 @@ public class SharedSchemaRepositoryTests : IDisposable
|
||||
Assert.Null(missing);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that add duplicate name throws.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task Add_DuplicateName_Throws()
|
||||
{
|
||||
@@ -75,6 +83,8 @@ public class SharedSchemaRepositoryTests : IDisposable
|
||||
_repository.AddAsync(new SharedSchema { Name = "Dup", SchemaJson = "{}" }));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that nullable scope round trips.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task NullableScope_RoundTrips()
|
||||
{
|
||||
@@ -85,6 +95,8 @@ public class SharedSchemaRepositoryTests : IDisposable
|
||||
Assert.Null(loaded!.Scope);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that list returns all ordered by name.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task List_ReturnsAll_OrderedByName()
|
||||
{
|
||||
@@ -97,6 +109,8 @@ public class SharedSchemaRepositoryTests : IDisposable
|
||||
Assert.Equal("Bravo", all[1].Name);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that update persists changes.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task Update_PersistsChanges()
|
||||
{
|
||||
@@ -114,6 +128,8 @@ public class SharedSchemaRepositoryTests : IDisposable
|
||||
Assert.Equal("Updated", reloaded.Scope);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that delete removes row.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task Delete_RemovesRow()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user