Esempio n. 1
0
        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();
            }
        }
Esempio n. 2
0
 public static void Sleep(this TestKit @this, int milliseconds) =>
 Thread.Sleep(@this.Dilated(TimeSpan.FromMilliseconds(milliseconds)));
Esempio n. 3
0
 public static void Sleep(this TestKit @this, TimeSpan span) =>
 Thread.Sleep(@this.Dilated(span));