public void RunWithTimeout() { bool timedOut = ThreadRunner.WithTimeout(RunTimesOutEndlessLoop, TimeSpan.FromSeconds(0.1)).Run(); Assert.That(timedOut, Is.True); }
public void RunWithoutTimeout() { bool timedOut = ThreadRunner.WithTimeout(RunTimesOutVeryFastFunction, TimeSpan.FromMilliseconds(int.MaxValue)).Run(); Assert.That(timedOut, Is.False); }
public void WithTimeout() { ThreadRunner threadRunner = ThreadRunner.WithTimeout(delegate { }, TimeSpan.FromMinutes(250)); Assert.That(threadRunner.Timeout, Is.EqualTo(TimeSpan.FromMinutes(250))); }