public void ThrowsRightExceptionBeforeTimeout() { var t1 = TestTasks.GetResult(TimeSpan.FromSeconds(2), 1); Assert.ThrowsAsync <ArgumentException>(async() => await t1.WithTimeout(TimeSpan.FromSeconds(1))); }
public void ThrowsTimeoutExceptionBeforeArgument() { var t1 = TestTasks.GetResult(TimeSpan.FromSeconds(5), 2); Assert.ThrowsAsync <TaskCanceledException>(async() => await t1.WithTimeout(TimeSpan.FromSeconds(2))); }
public void NotThrowsBeforeTimeout() { var t1 = TestTasks.GetResult(TimeSpan.FromSeconds(2), 0); Assert.DoesNotThrowAsync(async() => await t1.WithTimeout(TimeSpan.FromSeconds(5))); }