コード例 #1
0
        public void ShouldGuardWhenFinished()
        {
            // Arrange
            MockCountdownTimerElapsedAction nextAction        = new MockCountdownTimerElapsedAction.Builder().Build();
            MockCountdownState mockCountdownState             = new MockCountdownState.Builder().Finished(Bool.True).Build();
            MockCountdownTimer mockCountdownTimer             = new MockCountdownTimer.Builder().CountdownState(mockCountdownState).Close().Build();
            CountdownTimerElapsedAction_FinishedGuard subject = new CountdownTimerElapsedAction_FinishedGuard(nextAction);

            // Act
            subject.Act(mockCountdownTimer);

            // Assert
            mockCountdownTimer.AssertCloseInvoked();
        }
コード例 #2
0
        public void ShouldNextActWhenNotFinished()
        {
            // Arrange
            MockCountdownTimerElapsedAction nextAction        = new MockCountdownTimerElapsedAction.Builder().Act().Build();
            MockCountdownState mockCountdownState             = new MockCountdownState.Builder().Finished(Bool.False).Build();
            MockCountdownTimer mockCountdownTimer             = new MockCountdownTimer.Builder().CountdownState(mockCountdownState).Build();
            CountdownTimerElapsedAction_FinishedGuard subject = new CountdownTimerElapsedAction_FinishedGuard(nextAction);

            // Act
            subject.Act(mockCountdownTimer);

            // Assert
            nextAction.AssertActInvokedWith(mockCountdownTimer);
        }