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:
+13
-2
@@ -22,7 +22,7 @@ using TransportImportPage = ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages.Des
|
||||
namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Pages.Design;
|
||||
|
||||
/// <summary>
|
||||
/// Regression tests for register row 103 (the P6-6 lesser instance in
|
||||
/// Regression tests for register row 103 (the lesser instance in
|
||||
/// <c>TransportImport</c>). <c>TryLoadAsync</c> awaits
|
||||
/// <see cref="IBundleImporter.LoadAsync"/>, then used to publish the result into
|
||||
/// <c>_session</c> unconditionally. If the circuit was torn down inside that await
|
||||
@@ -31,7 +31,7 @@ namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Pages.Design;
|
||||
/// <c>BundleSession</c> stayed registered, stranding one of
|
||||
/// <c>TransportOptions.MaxConcurrentImportSessions</c> (register row 43) for the full
|
||||
/// session TTL. The fix publishes the session and re-checks disposal under one lock
|
||||
/// (<c>_sessionLock</c>), mirroring <c>DebugView</c>'s P6-6 fix, so exactly one side
|
||||
/// (<c>_sessionLock</c>), mirroring <c>DebugView</c>'s fix, so exactly one side
|
||||
/// (this method or <c>Dispose</c>) abandons it.
|
||||
/// </summary>
|
||||
public class TransportImportSessionDisposeRaceTests : BunitContext
|
||||
@@ -48,6 +48,7 @@ public class TransportImportSessionDisposeRaceTests : BunitContext
|
||||
private readonly TaskCompletionSource _entered = new(TaskCreationOptions.RunContinuationsAsynchronously);
|
||||
private readonly List<Guid> _abandoned = new();
|
||||
|
||||
/// <summary>Gets the session store used by the test.</summary>
|
||||
public BundleSessionStore Store { get; } = new(
|
||||
Options.Create(new TransportOptions()), TimeProvider.System);
|
||||
|
||||
@@ -60,8 +61,10 @@ public class TransportImportSessionDisposeRaceTests : BunitContext
|
||||
get { lock (_abandoned) { return _abandoned.ToList(); } }
|
||||
}
|
||||
|
||||
/// <summary>Releases the load that is blocked waiting for the test to let it finish.</summary>
|
||||
public void ReleaseLoad() => _gate.TrySetResult();
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<BundleSession> LoadAsync(
|
||||
Stream bundleStream, string? passphrase, CancellationToken ct = default, string? clientKey = null)
|
||||
{
|
||||
@@ -89,9 +92,11 @@ public class TransportImportSessionDisposeRaceTests : BunitContext
|
||||
return Store.Open(session);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<ImportPreview> PreviewAsync(Guid sessionId, CancellationToken ct = default)
|
||||
=> throw new NotSupportedException("Not exercised by these tests.");
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<ImportResult> ApplyAsync(
|
||||
Guid sessionId,
|
||||
IReadOnlyList<ImportResolution> resolutions,
|
||||
@@ -100,6 +105,7 @@ public class TransportImportSessionDisposeRaceTests : BunitContext
|
||||
BundleNameMap? nameMap = null)
|
||||
=> throw new NotSupportedException("Not exercised by these tests.");
|
||||
|
||||
/// <inheritdoc />
|
||||
public void Abandon(Guid sessionId)
|
||||
{
|
||||
lock (_abandoned) { _abandoned.Add(sessionId); }
|
||||
@@ -116,6 +122,7 @@ public class TransportImportSessionDisposeRaceTests : BunitContext
|
||||
private readonly ISiteRepository _siteRepo = Substitute.For<ISiteRepository>();
|
||||
private const string TestClientIp = "203.0.113.7";
|
||||
|
||||
/// <summary>Initializes the test class and its fake session service.</summary>
|
||||
public TransportImportSessionDisposeRaceTests()
|
||||
{
|
||||
JSInterop.Mode = JSRuntimeMode.Loose;
|
||||
@@ -181,6 +188,8 @@ public class TransportImportSessionDisposeRaceTests : BunitContext
|
||||
return task!;
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a component disposed mid-load abandons the session that was just opened.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task TryLoadAsync_DisposedMidLoad_AbandonsTheJustOpenedSession()
|
||||
{
|
||||
@@ -203,6 +212,8 @@ public class TransportImportSessionDisposeRaceTests : BunitContext
|
||||
Assert.Null(_importer.Store.Get(_importer.Abandoned[0]));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that loading and then disposing abandons the session exactly once.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task TryLoadAsync_ThenDispose_AbandonsTheSessionExactlyOnce()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user