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