public void Start_TimerTick_ShortEnough()
        {
            ManualResetEvent pause = new ManualResetEvent(false);

            uut.TimerTick += (sender, args) => pause.Set();
            uut.Start(2000);

            // wait for a tick, but no longer
            Assert.That(pause.WaitOne(1100));

            uut.Stop();
        }
예제 #2
0
        public void Start_TimerTick_ShortEnough()
        {
            ManualResetEvent pause = new ManualResetEvent(false);

            uut.TimerTick += (sender, args) => pause.Set();
            // Changed from milliseconds to seconds
            // 10 seconds
            uut.Start(60 / 6);

            // wait for a tick, but no longer
            // A bit more than 10 sekunder
            Assert.That(pause.WaitOne(10100));

            uut.Stop();
        }
예제 #3
0
 public void Stop_NotStarted_NoThrow()
 {
     Assert.That(() => uut.Stop(), Throws.Nothing);
 }