Exemplo n.º 1
0
        public void NotThrowsBeforeTimeoutNonGeneric()
        {
            var t1 = TestTasks.ProcessTask(TimeSpan.FromSeconds(2), 0);

            Assert.DoesNotThrowAsync(async() =>
                                     await t1.WithTimeout(TimeSpan.FromSeconds(5)));
        }
Exemplo n.º 2
0
        public void ThrowsOnTimeoutNonGeneric()
        {
            var t1 = TestTasks.ProcessTask(TimeSpan.FromSeconds(5), 0);

            Assert.ThrowsAsync <TaskCanceledException>(async() =>
                                                       await t1.WithTimeout(TimeSpan.FromSeconds(2)));
        }