private void AssertMission(Mission mission, int x, int y, Direction facing, string commands)
 {
     Assert.AreEqual(x, mission.Robot.X);
     Assert.AreEqual(y, mission.Robot.Y);
     Assert.AreEqual(facing, mission.Robot.Facing);
     Assert.AreEqual(commands, mission.Commands);
 }
Esempio n. 2
0
 private Robot RunMission(Mission mission)
 {
     // We will run the commands with a copy of the mission's robot, so the original is untouched.
     Robot robot = new Robot(mission.Robot);
     // mission.Commands is a string where each character will be interpreted by the robot as a command.
     foreach (char c in mission.Commands) {
         robot.ExecuteCommand(c.ToString(), config.Grid);
     }
     return robot;
 }