示例#1
0
        public void StartCooking_OnTimerTick_DisplayTimeRemaining()
        {
            input.StartCooking(50, 21);

            input.OnTimerTick(timer, EventArgs.Empty);

            output.Received().OutputLine(Arg.Is <string>(str => str.Contains($"00:21")));
        }
示例#2
0
        public void Display_ShowTime_OnTimerTick_OutputIsCorrect()
        {
            _cookController.StartCooking(50,500);
            _output.ClearReceivedCalls();

            _cookController.OnTimerTick(_timer, EventArgs.Empty);

            _output.Received().OutputLine("Display shows: 08:20");
        }
示例#3
0
 public void OnTimerTick_InputIs30Sec_OutputShows0030(int min, int sec)
 {
     _uut.StartCooking(50, sec);
     _timer.TimeRemaining.Returns(sec);
     _uut.OnTimerTick(_timer, EventArgs.Empty);
     _output.Received().OutputLine($"Display shows: {min:D2}:{sec:D2}");
 }
        public void OnTimerTick_ShowsTimeRemaining_RemainingTimeIsCorrect(int totalSeconds, int min, int sec)
        {
            _timer.TimeRemaining.Returns(totalSeconds);

            _cookController.OnTimerTick(_timer, EventArgs.Empty);

            string compareString = $"Display shows: {min:D2}:{sec:D2}";

            _output.Received().OutputLine(compareString);
        }
 public void Display_OnTimerTick_ShowRemainingTime(int remaningSeconds, int min, int sec)
 {
     _timer.TimeRemaining.Returns(remaningSeconds);
     _cookController.OnTimerTick(_timer, EventArgs.Empty);
     _display.Received(1).ShowTime(min, sec);
 }
 public void showTime_MinAndSec_OutputContainsCorrectMinAndSec(int time, string expected)
 {
     _sut.StartCooking(350, time);
     _sut.OnTimerTick(this, EventArgs.Empty);
     _output.Received().OutputLine(Arg.Is <string>(s => s.Contains((expected))));
 }
示例#7
0
 public void ShowTime__CookController_Display__OnTimerTick(int s1, string s2)
 {
     _cookController.StartCooking(100, s1);
     _cookController.OnTimerTick(this, EventArgs.Empty);
     _output.Received().OutputLine(Arg.Is <string>(t => t.Contains(Convert.ToString("Display shows: " + s2))));
 }
示例#8
0
 public void CookingControllerCallsDisplayWithShowTimerDisplayCallOutput()
 {
     _sut.StartCooking(50, 11);
     _sut.OnTimerTick(new object(), EventArgs.Empty);
     _output.Received().OutputLine(Arg.Is <string>(x => x == "Display shows: 00:10"));
 }