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:
+23
-4
@@ -18,21 +18,25 @@ public class SchemaConfigurationTests : IDisposable
|
||||
{
|
||||
private readonly ScadaBridgeDbContext _context;
|
||||
|
||||
/// <summary>Creates an in-memory SQLite context for each test.</summary>
|
||||
public SchemaConfigurationTests()
|
||||
{
|
||||
_context = SqliteTestHelper.CreateInMemoryContext();
|
||||
}
|
||||
|
||||
/// <summary>Releases the resources held by this instance.</summary>
|
||||
public void Dispose()
|
||||
{
|
||||
_context.Database.CloseConnection();
|
||||
_context.Dispose();
|
||||
}
|
||||
|
||||
// ConfigurationDatabase-006: the gRPC node-address columns must be length-bounded
|
||||
// The gRPC node-address columns must be length-bounded
|
||||
// (HasMaxLength(500)) consistently with the sibling NodeAAddress/NodeBAddress columns,
|
||||
// rather than being left to map to nvarchar(max).
|
||||
|
||||
/// <summary>Verifies that the gRPC node address columns are limited to 500 characters.</summary>
|
||||
/// <param name="propertyName">The gRPC node address property under test.</param>
|
||||
[Theory]
|
||||
[InlineData(nameof(Site.GrpcNodeAAddress))]
|
||||
[InlineData(nameof(Site.GrpcNodeBAddress))]
|
||||
@@ -45,6 +49,8 @@ public class SchemaConfigurationTests : IDisposable
|
||||
Assert.Equal(500, property.GetMaxLength());
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the gRPC node address columns match the length bound of the sibling node address columns.</summary>
|
||||
/// <param name="siblingPropertyName">The sibling node address property to compare against.</param>
|
||||
[Theory]
|
||||
[InlineData(nameof(Site.NodeAAddress))]
|
||||
[InlineData(nameof(Site.NodeBAddress))]
|
||||
@@ -57,12 +63,15 @@ public class SchemaConfigurationTests : IDisposable
|
||||
Assert.Equal(siblingMaxLength, entity.FindProperty(nameof(Site.GrpcNodeBAddress))!.GetMaxLength());
|
||||
}
|
||||
|
||||
// ConfigurationDatabase-014: the encrypting value converter must be applied
|
||||
// The encrypting value converter must be applied
|
||||
// uniformly to all three secret-bearing columns, including the non-nullable
|
||||
// DatabaseConnectionDefinition.ConnectionString. A regression here (e.g. the
|
||||
// converter dropped from one HasConversion call) would silently store a secret
|
||||
// in plaintext.
|
||||
|
||||
/// <summary>Verifies that every secret-bearing column has the encrypted string converter applied.</summary>
|
||||
/// <param name="entityType">The entity type that owns the column.</param>
|
||||
/// <param name="propertyName">The secret-bearing property under test.</param>
|
||||
[Theory]
|
||||
[InlineData(typeof(SmtpConfiguration), nameof(SmtpConfiguration.Credentials))]
|
||||
[InlineData(typeof(ExternalSystemDefinition), nameof(ExternalSystemDefinition.AuthConfiguration))]
|
||||
@@ -82,6 +91,7 @@ public class SchemaConfigurationTests : IDisposable
|
||||
// A filtered index over just the non-terminal rows turns each count from a clustered
|
||||
// scan of the 365-day archive into a small seek. Locked shape:
|
||||
// key = CreatedAtUtc, filter = [TerminalAtUtc] IS NULL, INCLUDE SourceSite/SourceNode/Status.
|
||||
/// <summary>Verifies that the site calls table has a filtered index over non-terminal rows.</summary>
|
||||
[Fact]
|
||||
public void SiteCalls_Has_Filtered_NonTerminal_Index()
|
||||
{
|
||||
@@ -100,9 +110,10 @@ public class SchemaConfigurationTests : IDisposable
|
||||
|
||||
// arch-review 04 round 2 (R6): the daily terminal retention purge filters on
|
||||
// TerminalAtUtc IS NOT NULL AND TerminalAtUtc < cutoff. A filtered index over the
|
||||
// terminal population lets the purge (and Task 11's MIN() slice anchor) seek the
|
||||
// terminal population lets the purge (and the MIN() slice anchor) seek the
|
||||
// expired tail instead of full-scanning the 365-day table. Locked shape:
|
||||
// key = TerminalAtUtc, filter = [TerminalAtUtc] IS NOT NULL.
|
||||
/// <summary>Verifies that the site calls table has a filtered index over terminal rows.</summary>
|
||||
[Fact]
|
||||
public void SiteCalls_Has_Filtered_Terminal_Index()
|
||||
{
|
||||
@@ -119,6 +130,8 @@ public class SchemaConfigurationTests : IDisposable
|
||||
// .IsMesReportableOverride (null = inherit) must both round-trip through the
|
||||
// configuration database. Backed on SQL Server by the AddAlarmMesReportable
|
||||
// migration; pinned here on the model/persist path.
|
||||
/// <summary>Verifies that template alarms and their overrides persist the MES-reportable flags.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task TemplateAlarm_And_Override_PersistMesReportableFlags()
|
||||
{
|
||||
@@ -159,22 +172,26 @@ public class SplitQueryBehaviourTests : IDisposable
|
||||
private readonly ScadaBridgeDbContext _context;
|
||||
private readonly TemplateEngineRepository _repository;
|
||||
|
||||
/// <summary>Creates an in-memory SQLite context and a template repository for each test.</summary>
|
||||
public SplitQueryBehaviourTests()
|
||||
{
|
||||
_context = SqliteTestHelper.CreateInMemoryContext();
|
||||
_repository = new TemplateEngineRepository(_context, new TemplateGraphWatermark());
|
||||
}
|
||||
|
||||
/// <summary>Releases the resources held by this instance.</summary>
|
||||
public void Dispose()
|
||||
{
|
||||
_context.Database.CloseConnection();
|
||||
_context.Dispose();
|
||||
}
|
||||
|
||||
// ConfigurationDatabase-009: the multi-collection eager-load queries were switched to
|
||||
// The multi-collection eager-load queries were switched to
|
||||
// AsSplitQuery() to avoid cartesian-product joins. The result set must be unchanged —
|
||||
// every member collection still fully populated, with no row duplication.
|
||||
|
||||
/// <summary>Verifies that loading all templates with several members per collection returns every member without duplication.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task GetAllTemplatesAsync_WithMultipleMembersPerCollection_LoadsAllWithoutDuplication()
|
||||
{
|
||||
@@ -199,6 +216,8 @@ public class SplitQueryBehaviourTests : IDisposable
|
||||
Assert.Equal(4, loaded.Scripts.Count);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that loading a template by id with several members populates all of its collections.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task GetTemplateByIdAsync_WithMultipleMembers_LoadsAllCollections()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user