public void StartTimer_StopTimer_NoExceptions() { using (var timer = new CallbackTimer(TimerMode.Periodic)) { timer.StartTimer(); timer.StopTimer(); } }
public void StopTimer_OnNewInstance_StoppedEventFires() { using (var timer = new CallbackTimer(TimerMode.Periodic)) { bool eventFired = false; timer.Stopped += (sender, e) => { eventFired = true; }; timer.StartTimer(); timer.StopTimer(); eventFired.Should().BeTrue(); } }