public void TestOrderSet() { _robot.SetOrders("FRL"); Assert.AreEqual(_robot.GetNextOrder(), 'F'); Assert.AreEqual(_robot.GetNextOrder(), 'R'); Assert.AreEqual(_robot.GetNextOrder(), 'L'); }
public void ExecuteNextCommand(IRobot robot) { var robotCommand = robot.GetNextOrder(); if (!_instructions.ContainsKey(robotCommand)) { throw new ArgumentException($"Unknown command '{robotCommand}'"); } Console.WriteLine($"Execution command \"{robotCommand}\":"); _instructions[robotCommand].ExecuteCommandFor(robot); }