I can assert that a task should complete within a specified maximum time like this:
await obj.Awaiting( o => o.DoSomethingAsync() ).Should().CompleteWithinAsync( 1.Second() );
But how can I also require that the task also takes at least a certain amount of time to complete? For example, I want to assert that the task should take between 1 and 2 seconds to complete, such that taking less than 1 second or more than 2 seconds indicates failure?
I'm aware of NotCompleteWithinAsync
, but I can't work out how to combine both CompleteWithinAsync
and NotCompleteWithinAsync
in one assertion.