CompletesWithin(TimeSpan) and ThrowsWithin(TimeSpan) assertions#1797
Conversation
|
Thank you ! |
You're right, it wouldn't. The assertions library isn't currently set up to abort tasks. I'd need to pass a cancellation token to the delegate used in the Assert.That and you'd need to use that in your task. Is that how FA did it? |
Yeah that's what I figured when I tried it myself. FA don't bother with cancellation token. It creates a new Task with a Timer and use |
From what I can tell, that won't cancel that task, it'll just leave it in the background. But it does solve the problem of not waiting for it which TUnit currently would. I'll have to have a think. Might be a chunky refactor. |
cc @AlexandreBossard