public void CannotSetCommandListUntilRobotHasStartingLocation() { var commandList = new List <RobotCommand>(); var robot = new WarriorRobot(); Assert.Throws <WarriorRobot.StartLocationNotSetException>(() => robot.ExecuteCommandList(commandList)); }
public void CanProvideCommandsToRobot() { var commandList = new List <RobotCommand>(); var robot = new WarriorRobot(); robot.UploadArena(new Arena(1, 1)); robot.StartAt(SimpleVector()); robot.ExecuteCommandList(commandList); }
public void ExecutingASingleCommandUpdatesThePositionAsExpected() { var startPosition = new RobotVector(new Position(0, 0), Heading.North); var robot = new WarriorRobot(); robot.UploadArena(new Arena(1, 1)); robot.StartAt(startPosition); var commandList = new List <RobotCommand>(); commandList.Add(new MoveForwards()); robot.ExecuteCommandList(commandList); RobotVector reportedPosition = robot.ReportPosition(); Assert.That(startPosition, Is.Not.EqualTo(reportedPosition)); }