private void ExecutePause(object obj) { TimerService.Pause(); _applicationStateService.CurrentState.ActiveTimeEntry = TimeEntry; _applicationStateService.CurrentState.ActiveTaskState = TimerState.Paused; TaskCommands.TaskIdle.Execute(TaskName); Update(); }
public void TimerService_TimerPaused_IsNotRunning() { // Arrange var unitUnderTest = new TimerService(); unitUnderTest.Start(100); // Act unitUnderTest.Pause(); // Arrange Assert.IsFalse(unitUnderTest.IsRunning); }
public void TimerService_TimerResumed_IsRunning() { // Arrange var unitUnderTest = new TimerService(); unitUnderTest.Start(100); unitUnderTest.Pause(); // Act unitUnderTest.Resume(); // Arrange Assert.IsTrue(unitUnderTest.IsRunning); }
public void TimerService_TimerPaused_NoEventsThrown() { // Arrange var timerElapsedEvent = new AutoResetEvent(false); var unitUnderTest = new TimerService(); unitUnderTest.Elapsed += (sender, args) => timerElapsedEvent.Set(); unitUnderTest.Start(100); // Act unitUnderTest.Pause(); timerElapsedEvent.Reset(); // Assert Assert.IsFalse(timerElapsedEvent.WaitOne(200), "Did not expected Elapsed event"); }