Пример #1
0
        public void WaitNonLocking_success()
        {
            var task = new Task(() => Thread.Sleep(50));
            task.Start();
            task.WaitNonLocking(TimeSpan.FromMilliseconds(1000));

            Assert.IsTrue(task.IsCompleted);
        }
Пример #2
0
 public void WaitNonLocking_timeout_exception()
 {
     var task = new Task(() => Thread.Sleep(1000));
     task.Start();
     Assert.Throws<TimeoutException>(() => task.WaitNonLocking(TimeSpan.FromMilliseconds(200)));
 }