public void CookController_OnTimerExpired_Returns()
        {
            input.StartCooking(1, 30);
            input.OnTimerExpired(new object(), EventArgs.Empty);

            output.Received().OutputLine(Arg.Is <string>(str => str.Contains("off")));
        }
 public void OnTimerExpired_IsCooking_OutputShowsPowerTubeIsTurnedOff()
 {
     _cookController.StartCooking(20, 10);
     _output.ClearReceivedCalls();
     _cookController.OnTimerExpired(_timer, EventArgs.Empty);
     _output.Received().OutputLine(Arg.Is <string>(str => str.Contains("off")));
 }
 public void CookingIsDone_OnTimeExpired_DisplayCleared_Test()
 {
     _powerButton.Pressed       += Raise.EventWith(this, EventArgs.Empty);
     _timeButton.Pressed        += Raise.EventWith(this, EventArgs.Empty);
     _StartCancelButton.Pressed += Raise.EventWith(this, EventArgs.Empty);
     _sut.OnTimerExpired(this, EventArgs.Empty);
     _output.Received().OutputLine("Display cleared");
 }
示例#4
0
        public void OnTimerExpired_SetCookingState_DisplayIsCleared()
        {
            _userInterface.OnPowerPressed(null, EventArgs.Empty);
            _userInterface.OnTimePressed(null, EventArgs.Empty);
            _userInterface.OnStartCancelPressed(null, EventArgs.Empty);
            _output.ClearReceivedCalls();

            _cookController.OnTimerExpired(null, EventArgs.Empty);

            _output.Received(1).OutputLine("Display cleared");
        }
示例#5
0
        public void OnTimerExpired_TimerOn_Returns()
        {
            input.StartCooking(50, 50);
            input.OnTimerExpired(timer, EventArgs.Empty);

            output.Received(1).OutputLine(Arg.Is <string>(str => str.Contains("off")));
        }
示例#6
0
 public void OnTimeExpiredOutputsCorrect()
 {
     _powerButton.Pressed       += Raise.EventWith(this, EventArgs.Empty);
     _timeButton.Pressed        += Raise.EventWith(this, EventArgs.Empty);
     _startCancelButton.Pressed += Raise.EventWith(this, EventArgs.Empty);
     _sut.OnTimerExpired(this, EventArgs.Empty);
     _output.Received().OutputLine("Display cleared");
 }
示例#7
0
        public void Test_SUT_To_Timer_Stop()
        {
            _sut.StartCooking(50, 50);
            _sut.OnTimerExpired(this, EventArgs.Empty);
            _fakeOutput.Received().OutputLine(Arg.Is <string>(str => str.Contains("off")));

            _timer.Stop();
        }
        public void TimerExpired_Cooking_PowerTubeOff()
        {
            _cookController.StartCooking(50, 60);

            _cookController.OnTimerExpired(null, EventArgs.Empty);

            _output.Received(1).OutputLine("PowerTube turned off");
        }
示例#9
0
        public void PowerTube_TurnOff_TimerExpired_OutputIsCorrect()
        {
            _cookController.StartCooking(50, 500);
            _cookController.OnTimerTick(_timer, EventArgs.Empty);
            _output.ClearReceivedCalls();

            _cookController.OnTimerExpired(_timer, EventArgs.Empty);

            _output.Received().OutputLine("PowerTube turned off");
        }
示例#10
0
 public void OnTimerExpired_OutputShowsPowerOff()
 {
     _uut.StartCooking(50, 30);
     _uut.OnTimerExpired(_timer, EventArgs.Empty);
     _output.Received().OutputLine($"PowerTube turned off");
 }