public async Task Should_complete_within_finishes() { // arrange var asyncAssertions = new AsyncActionAssertions(() => Tester(false)); // act + assert await asyncAssertions.ShouldCompleteWithin(200.Milliseconds()); }
public static async Task ShouldCompleteWithin(this Task task, TimeSpan time, string reason = "", params object[] reasonArgs) { var assertions = new AsyncActionAssertions(() => task); await assertions.ShouldCompleteWithin(time, reason, reasonArgs); }