Пример #1
0
        public void Start_TimerTick_ShortEnough()
        {
            ManualResetEvent pause = new ManualResetEvent(false);

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

            // 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();
        }