test: pass TestContext.Current.CancellationToken at xUnit1051 call sites (analyzer code fix, 451 sites) (lmxopcua#725)

Claude-Session: https://claude.ai/code/session_01GT67AEHd2Acv1YPwGfXEoV
This commit is contained in:
Joseph Doherty
2026-11-09 13:19:34 -05:00
parent 5db01053e8
commit 1d7a4b7a53
77 changed files with 452 additions and 457 deletions
@@ -53,7 +53,7 @@ public sealed class ScriptedAlarmSourceTests
var handle = await source.SubscribeAlarmsAsync([], TestContext.Current.CancellationToken);
up.Push("Temp", 150);
await Task.Delay(200);
await Task.Delay(200, TestContext.Current.CancellationToken);
events.Count.ShouldBe(1);
events[0].ConditionId.ShouldBe("Plant/Line1::HighTemp");
@@ -80,7 +80,7 @@ public sealed class ScriptedAlarmSourceTests
var handle = await source.SubscribeAlarmsAsync(["Plant/Line1"], TestContext.Current.CancellationToken);
up.Push("Temp", 150);
await Task.Delay(200);
await Task.Delay(200, TestContext.Current.CancellationToken);
events.Count.ShouldBe(1);
events[0].SourceNodeId.ShouldBe("Plant/Line1");
@@ -102,7 +102,7 @@ public sealed class ScriptedAlarmSourceTests
await source.UnsubscribeAlarmsAsync(handle, TestContext.Current.CancellationToken);
up.Push("Temp", 150);
await Task.Delay(200);
await Task.Delay(200, TestContext.Current.CancellationToken);
events.Count.ShouldBe(0);
}
@@ -124,7 +124,7 @@ public sealed class ScriptedAlarmSourceTests
// Drive HighTemp's input Bad: the predicate freezes (no transition), but the worst-quality bucket
// moves Good→Bad → the engine emits QualityChanged. The source must swallow it.
up.Push("Temp", 50, 0x80000000u);
await Task.Delay(200);
await Task.Delay(200, TestContext.Current.CancellationToken);
events.ShouldBeEmpty();
}
@@ -138,7 +138,7 @@ public sealed class ScriptedAlarmSourceTests
using var _s = source;
up.Push("Temp", 150);
await Task.Delay(200);
await Task.Delay(200, TestContext.Current.CancellationToken);
engine.GetState("Plant/Line1::HighTemp")!.Acked.ShouldBe(AlarmAckedState.Unacknowledged);
await source.AcknowledgeAsync([new AlarmAcknowledgeRequest(
@@ -165,7 +165,7 @@ public sealed class ScriptedAlarmSourceTests
// Supplied principal -> honored.
up.Push("Temp", 150);
await Task.Delay(200);
await Task.Delay(200, TestContext.Current.CancellationToken);
await source.AcknowledgeAsync([new AlarmAcknowledgeRequest(
"Plant/Line1", "Plant/Line1::HighTemp", "ack as bob", "bob")],
TestContext.Current.CancellationToken);
@@ -173,9 +173,9 @@ public sealed class ScriptedAlarmSourceTests
// No principal -> default audit identity.
up.Push("Temp", 50);
await Task.Delay(200);
await Task.Delay(200, TestContext.Current.CancellationToken);
up.Push("Temp", 150);
await Task.Delay(200);
await Task.Delay(200, TestContext.Current.CancellationToken);
await source.AcknowledgeAsync([new AlarmAcknowledgeRequest(
"Plant/Line1", "Plant/Line1::HighTemp", "ack anon", null)],
TestContext.Current.CancellationToken);