public static void WithinTimeout(this TestKit @this, Action act) { // Double timeout as some tests need to wait for time out for the TestLatch to throw TimeSpan span = @this.Dilated(@this.GetTimeoutDoubled()); if (!Task.Run(act).Wait(span)) { throw new TimeoutException(); } }
public static void Sleep(this TestKit @this, int milliseconds) => Thread.Sleep(@this.Dilated(TimeSpan.FromMilliseconds(milliseconds)));
public static void Sleep(this TestKit @this, TimeSpan span) => Thread.Sleep(@this.Dilated(span));