Esempio n. 1
0
 private void ExecutePause(object obj)
 {
     TimerService.Pause();
     _applicationStateService.CurrentState.ActiveTimeEntry = TimeEntry;
     _applicationStateService.CurrentState.ActiveTaskState = TimerState.Paused;
     TaskCommands.TaskIdle.Execute(TaskName);
     Update();
 }
Esempio n. 2
0
        public void TimerService_TimerPaused_IsNotRunning()
        {
            // Arrange
            var unitUnderTest = new TimerService();

            unitUnderTest.Start(100);

            // Act
            unitUnderTest.Pause();

            // Arrange
            Assert.IsFalse(unitUnderTest.IsRunning);
        }
Esempio n. 3
0
        public void TimerService_TimerResumed_IsRunning()
        {
            // Arrange
            var unitUnderTest = new TimerService();

            unitUnderTest.Start(100);
            unitUnderTest.Pause();

            // Act
            unitUnderTest.Resume();

            // Arrange
            Assert.IsTrue(unitUnderTest.IsRunning);
        }
Esempio n. 4
0
        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");
        }