Exemple #1
0
        public async Task SleepAsync__withTimeSpan_sleepsExpectedAmount(int sleep)
        {
            stopwatch.Start();
            await sleeper.SleepAsync(TimeSpan.FromMilliseconds(sleep));

            stopwatch.Stop();

            Assert.InRange(stopwatch.ElapsedMilliseconds, sleep - 50, long.MaxValue);
        }