예제 #1
0
        private static void RunCommandLoop(MicrowaveOvenHw microwave)
        {
            while (true)
            {
                PrintMenu();
                var commandNumer = 0;
                var result       = Console.ReadLine();
                if (int.TryParse(result, out commandNumer))
                {
                    switch (commandNumer)
                    {
                    case 1:
                        microwave.OpenDoor();
                        break;

                    case 2:
                        microwave.CloseDoor();
                        break;

                    case 3:
                        microwave.TurnOnHeater();
                        break;
                    }
                }
                else
                {
                    break;
                }
            }
        }
예제 #2
0
 public void WhenDoorIsOpenedThenLightdIsTurnedOn()
 {
     microwaveOvenHw.OpenDoor();
     lightMock.Verify(m => m.TurnOnLight(), Times.Once);
 }