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:
@@ -3,8 +3,8 @@ using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Shared;
|
||||
namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Shared;
|
||||
|
||||
/// <summary>
|
||||
/// Characterization tests for CentralUI-015 (re-triaged Won't Fix — see
|
||||
/// findings.md). The finding claimed <c>ContinueWith(..., TaskScheduler.Default)</c>
|
||||
/// Characterization tests for dialog service threading (a re-triaged
|
||||
/// Won't Fix finding). The finding claimed <c>ContinueWith(..., TaskScheduler.Default)</c>
|
||||
/// made callers resume off the render thread; that premise is incorrect — an
|
||||
/// <c>await</c> always resumes on the awaiter's own captured
|
||||
/// <see cref="SynchronizationContext"/> regardless of where the awaited task
|
||||
@@ -25,6 +25,7 @@ public class DialogServiceThreadingTests
|
||||
private readonly System.Collections.Concurrent.BlockingCollection<(SendOrPostCallback, object?)> _queue = new();
|
||||
public int PostedCount;
|
||||
|
||||
/// <summary>Initializes a new instance of the <c>TrackingSyncContext</c> class.</summary>
|
||||
public TrackingSyncContext()
|
||||
{
|
||||
_thread = new Thread(() =>
|
||||
@@ -38,15 +39,19 @@ public class DialogServiceThreadingTests
|
||||
_thread.Start();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Post(SendOrPostCallback d, object? state)
|
||||
{
|
||||
Interlocked.Increment(ref PostedCount);
|
||||
_queue.Add((d, state));
|
||||
}
|
||||
|
||||
/// <summary>Marks the synchronization context as complete.</summary>
|
||||
public void Complete() => _queue.CompleteAdding();
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the confirm dialog's awaiter resumes on its captured synchronization context.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task ConfirmAsync_AwaiterResumesOnItsCapturedSyncContext()
|
||||
{
|
||||
@@ -82,6 +87,8 @@ public class DialogServiceThreadingTests
|
||||
Assert.NotEqual(Environment.CurrentManagedThreadId, resumeThreadId);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the confirm dialog resolves with the expected value.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task ConfirmAsync_ResolvesWithExpectedValue()
|
||||
{
|
||||
@@ -93,6 +100,8 @@ public class DialogServiceThreadingTests
|
||||
Assert.True(await task);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the prompt dialog resolves with the entered value.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task PromptAsync_ResolvesWithExpectedValue()
|
||||
{
|
||||
@@ -104,6 +113,8 @@ public class DialogServiceThreadingTests
|
||||
Assert.Equal("typed value", await task);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a cancelled prompt dialog resolves to null.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
public async Task PromptAsync_CancelledResolvesToNull()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user