修复错误
This commit is contained in:
@@ -533,8 +533,13 @@ internal sealed class SynchronousProgress<T> : IProgress<T>
|
||||
.Returns(Task.CompletedTask);
|
||||
|
||||
using var cts = new CancellationTokenSource();
|
||||
// Cancel after 50ms — well before the 5000ms delay completes
|
||||
cts.CancelAfter(50);
|
||||
// Cancel after BeginRunAsync is called — ensures execution has started
|
||||
// but cancellation fires well before the 5000ms WaitDelay completes
|
||||
mockStore.Setup(s => s.BeginRunAsync(
|
||||
It.IsAny<InspectionRunRecord>(),
|
||||
It.IsAny<InspectionAssetWriteRequest>()))
|
||||
.Callback<InspectionRunRecord, InspectionAssetWriteRequest>((_, __) => cts.CancelAfter(50))
|
||||
.Returns(Task.CompletedTask);
|
||||
|
||||
await service.ExecuteAsync(program, null, cts.Token);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user