static void Main(string[] args) { IView view = new View(); ICommandReader reader = new CommandReader(view); IRobot robot = new Robot(); Controller controller = new Controller(view, reader, robot); controller.Run(); }
public void Run_should_display_places_cleaned() { Controller SUT = new Controller(_mockView.Object, _mockReader.Object, _mockRobot.Object); _mockReader.Setup(x => x.ReadAllCommands()).Returns(new CleanningSession( new Coordinate(0,0), new List<MoveCommand>())); _mockRobot.Setup(x => x.ExecuteClean(It.IsAny<CleanningSession>())).Returns(1001); _mockView.Setup(x => x.WriteLine(It.IsAny<String>())); SUT.Run(); _mockView.Verify(w => w.WriteLine(It.Is<string>(s => s == "=>Cleaned 1001")), Times.Once); }