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:
@@ -67,9 +67,9 @@ public sealed class ClusterAuditQueryTests : IDisposable
|
||||
// Noise that must NOT appear: other cluster's structured row + an orphan NodeId.
|
||||
SeedAudit("Published", clusterId: null, nodeId: "OTHER-A", ts: t0.AddMinutes(3));
|
||||
SeedAudit("Published", clusterId: null, nodeId: "UNKNOWN-NODE", ts: t0.AddMinutes(4));
|
||||
await _db.SaveChangesAsync();
|
||||
await _db.SaveChangesAsync(TestContext.Current.CancellationToken);
|
||||
|
||||
var rows = await ClusterAuditQuery.ForClusterAsync(_db, "LINE3-OPCUA", pageSize: 200);
|
||||
var rows = await ClusterAuditQuery.ForClusterAsync(_db, "LINE3-OPCUA", pageSize: 200, ct: TestContext.Current.CancellationToken);
|
||||
|
||||
rows.Select(r => r.EventType).ShouldBe(
|
||||
["NodeApplied", "DraftEdited", "Published"], // newest first
|
||||
@@ -83,9 +83,9 @@ public sealed class ClusterAuditQueryTests : IDisposable
|
||||
SeedNode("LINE3-OPCUA", "LINE3-OPCUA-A");
|
||||
var t0 = new DateTime(2026, 6, 2, 10, 0, 0, DateTimeKind.Utc);
|
||||
SeedAudit("Published", clusterId: "OTHER-CLUSTER", nodeId: null, ts: t0);
|
||||
await _db.SaveChangesAsync();
|
||||
await _db.SaveChangesAsync(TestContext.Current.CancellationToken);
|
||||
|
||||
var rows = await ClusterAuditQuery.ForClusterAsync(_db, "LINE3-OPCUA", pageSize: 200);
|
||||
var rows = await ClusterAuditQuery.ForClusterAsync(_db, "LINE3-OPCUA", pageSize: 200, ct: TestContext.Current.CancellationToken);
|
||||
|
||||
rows.ShouldBeEmpty();
|
||||
}
|
||||
@@ -98,9 +98,9 @@ public sealed class ClusterAuditQueryTests : IDisposable
|
||||
var t0 = new DateTime(2026, 6, 2, 10, 0, 0, DateTimeKind.Utc);
|
||||
for (var i = 0; i < 5; i++)
|
||||
SeedAudit("DraftEdited", clusterId: null, nodeId: "LINE3-OPCUA-A", ts: t0.AddMinutes(i));
|
||||
await _db.SaveChangesAsync();
|
||||
await _db.SaveChangesAsync(TestContext.Current.CancellationToken);
|
||||
|
||||
var rows = await ClusterAuditQuery.ForClusterAsync(_db, "LINE3-OPCUA", pageSize: 3);
|
||||
var rows = await ClusterAuditQuery.ForClusterAsync(_db, "LINE3-OPCUA", pageSize: 3, ct: TestContext.Current.CancellationToken);
|
||||
|
||||
rows.Count.ShouldBe(3);
|
||||
rows.First().Timestamp.ShouldBe(t0.AddMinutes(4)); // newest
|
||||
|
||||
Reference in New Issue
Block a user