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; } } }
public void WhenDoorIsOpenedThenLightdIsTurnedOn() { microwaveOvenHw.OpenDoor(); lightMock.Verify(m => m.TurnOnLight(), Times.Once); }