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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user