public void ShouldAct()
        {
            //Arrange
            MockMainForm                  mockMainForm       = new MockMainForm.Builder().Build();
            MockCountdownTimer            mockCountdownTimer = new MockCountdownTimer.Builder().Build();
            MockCountdownTimerStartAction nextAction         = new MockCountdownTimerStartAction.Builder().Act().Build();
            ShortBreakTimerStartAction    subject            = new PrivateCtor <ShortBreakTimerStartAction>(nextAction);

            //Act
            subject.Act(mockMainForm, mockCountdownTimer);

            //Assert
            nextAction.AssertActInvokedWith(mockMainForm, mockCountdownTimer);
        }
        public void ShouldAct()
        {
            // Arrange
            TimerProgress     timeProgress            = TimerProgress.Last;
            MockMainForm      mockMainForm            = new MockMainForm.Builder().Build();
            MockCountdownTime mockCountdownTime       = new MockCountdownTime.Builder().Build();
            MockCountdownTimerUpdateAction nextAction = new MockCountdownTimerUpdateAction.Builder().Act().Build();

            CountdownTimerUpdateAction_TimerRunning subject = new PrivateCtor <CountdownTimerUpdateAction_TimerRunning>(nextAction);

            // Act
            subject.Act(mockMainForm, mockCountdownTime, timeProgress);

            // Assert
            nextAction.AssertActInvokedWith(mockMainForm, mockCountdownTime, timeProgress);
        }
Exemple #3
0
        public void ShouldCallActOnEachAction()
        {
            //Arrange
            MockCountdownTimerUpdateAction finished = new MockCountdownTimerUpdateAction.Builder().Act().Build();
            MockCountdownTimerUpdateAction running  = new MockCountdownTimerUpdateAction.Builder().Act().Build();
            MockMainForm      mockMainForm          = new MockMainForm.Builder().Build();
            MockCountdownTime mockCountdownTime     = new MockCountdownTime.Builder().Build();

            SessionTimerUpdateAction subject = new PrivateCtor <SessionTimerUpdateAction>(finished, running);

            //Act
            subject.Act(mockMainForm, mockCountdownTime, TimerProgress.Last);

            //Assert
            finished.AssertActInvokedWith(mockMainForm, mockCountdownTime, TimerProgress.Last);
            running.AssertActInvokedWith(mockMainForm, mockCountdownTime, TimerProgress.Last);
        }
        public void ShouldCallActOnShortBreakWhenCounterLessThanSessionsToBreak()
        {
            //Arrange
            MockCountdownTimerUpdateAction shortBreak = new MockCountdownTimerUpdateAction.Builder().Act().Build();
            MockCountdownTimerUpdateAction longBreak  = new MockCountdownTimerUpdateAction.Builder().Build();
            MockCounter       mockCounter             = new MockCounter.Builder().Value(new NumberOf(3)).Increment().Build();
            MockMainForm      mockMainForm            = new MockMainForm.Builder().Build();
            MockCountdownTime mockCountdownTime       = new MockCountdownTime.Builder().Build();

            SessionTimerUpdateAction_ShowNextStart subject = new PrivateCtor <SessionTimerUpdateAction_ShowNextStart>(shortBreak, longBreak, mockCounter);

            //Act
            subject.Act(mockMainForm, mockCountdownTime, TimerProgress.Last);

            //Assert
            shortBreak.AssertActInvokedWith(mockMainForm, mockCountdownTime, TimerProgress.Last);
            mockCounter.AssertValueInvoked();
            mockCounter.AssertIncrementInvoked();
        }