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:
@@ -27,12 +27,18 @@ public class ScriptActorTraceTests : TestKit, IDisposable
|
||||
{
|
||||
private sealed class CapturingAuditWriter : IAuditWriter
|
||||
{
|
||||
/// <summary>The audit events captured so far.</summary>
|
||||
public List<AuditEvent> Events { get; } = new();
|
||||
/// <inheritdoc />
|
||||
public Task WriteAsync(AuditEvent evt, CancellationToken ct = default)
|
||||
{
|
||||
lock (Events) Events.Add(evt);
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
/// <summary>Polls the captured events until one with the given action appears or the timeout elapses.</summary>
|
||||
/// <param name="action">The audit action to wait for.</param>
|
||||
/// <param name="timeout">The maximum time to wait.</param>
|
||||
/// <returns>The first matching event, or <see langword="null"/> if none arrived in time.</returns>
|
||||
public AuditEvent? WaitForKind(string action, TimeSpan timeout)
|
||||
{
|
||||
var deadline = DateTime.UtcNow + timeout;
|
||||
@@ -55,6 +61,7 @@ public class ScriptActorTraceTests : TestKit, IDisposable
|
||||
private readonly CapturingAuditWriter _writer = new();
|
||||
private readonly IServiceProvider _services;
|
||||
|
||||
/// <summary>Creates the shared script library, options, scheduler and service provider used by every test.</summary>
|
||||
public ScriptActorTraceTests()
|
||||
{
|
||||
_sharedLibrary = new SharedScriptLibrary(
|
||||
@@ -67,6 +74,7 @@ public class ScriptActorTraceTests : TestKit, IDisposable
|
||||
_services = sc.BuildServiceProvider();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
void IDisposable.Dispose()
|
||||
{
|
||||
Shutdown();
|
||||
@@ -91,6 +99,7 @@ public class ScriptActorTraceTests : TestKit, IDisposable
|
||||
NullLogger<ScriptActor>.Instance, null, null, null, _services, _scheduler)));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a traced call replies with the execution ID and a ScriptRun trace event.</summary>
|
||||
[Fact]
|
||||
public void Call_WithTrace_ReplyCarriesExecutionId_AndAScriptRunEvent()
|
||||
{
|
||||
@@ -117,6 +126,7 @@ public class ScriptActorTraceTests : TestKit, IDisposable
|
||||
Assert.NotNull(_writer.WaitForKind("ScriptTrace.ScriptRun", TimeSpan.FromSeconds(5)));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a traced call whose script fails returns a failed ScriptRun trace event.</summary>
|
||||
[Fact]
|
||||
public void Call_WithTrace_FailedRun_ReturnsFailedScriptRunEvent()
|
||||
{
|
||||
@@ -132,6 +142,7 @@ public class ScriptActorTraceTests : TestKit, IDisposable
|
||||
Assert.Contains("kaboom", row.ErrorMessage);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that an untraced call replies with no trace events but still carries the execution ID.</summary>
|
||||
[Fact]
|
||||
public void Call_WithoutTrace_ReplyHasNoTraceEvents_ButStillCarriesExecutionId()
|
||||
{
|
||||
@@ -147,6 +158,9 @@ public class ScriptActorTraceTests : TestKit, IDisposable
|
||||
Assert.Empty(_writer.Events);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a traced value change makes the triggered run a child of the source execution ID.</summary>
|
||||
/// <param name="inferred">Whether the change is an inferred device update rather than a direct write.</param>
|
||||
/// <param name="triggerSource">The trigger source label stamped on the change.</param>
|
||||
[Theory]
|
||||
[InlineData(false, "value-change")]
|
||||
[InlineData(true, "inferred-device-update")]
|
||||
@@ -170,6 +184,7 @@ public class ScriptActorTraceTests : TestKit, IDisposable
|
||||
Assert.Equal(triggerSource, extra.TriggerSource);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that an untraced value change leaves the triggered run as a root and emits no trace events.</summary>
|
||||
[Fact]
|
||||
public void ValueChangeTrigger_UntracedChange_RunStaysRoot_AndEmitsNothing()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user