Ejemplo n.º 1
0
        public void RunWithTimeout()
        {
            bool timedOut = ThreadRunner.WithTimeout(RunTimesOutEndlessLoop, TimeSpan.FromSeconds(0.1)).Run();

            Assert.That(timedOut, Is.True);
        }
Ejemplo n.º 2
0
        public void RunWithoutTimeout()
        {
            bool timedOut = ThreadRunner.WithTimeout(RunTimesOutVeryFastFunction, TimeSpan.FromMilliseconds(int.MaxValue)).Run();

            Assert.That(timedOut, Is.False);
        }
Ejemplo n.º 3
0
        public void WithTimeout()
        {
            ThreadRunner threadRunner = ThreadRunner.WithTimeout(delegate { }, TimeSpan.FromMinutes(250));

            Assert.That(threadRunner.Timeout, Is.EqualTo(TimeSpan.FromMinutes(250)));
        }