mirror of
https://github.com/inf112-v20/Fiasko.git
synced 2025-01-31 23:29:36 +01:00
Legger til test for robotkollisjon i enden av transportbånd
Co-Authored-By: gabrielmagnus <gabrielmagnus@users.noreply.github.com>
This commit is contained in:
parent
1ac7ab5299
commit
210f72e0f2
@ -156,4 +156,26 @@ public class PhaseTest {
|
||||
assertEquals(robot5.getRobotId(), board.getRobotOnPosition(new Position(2, 12)));
|
||||
assertEquals(robot6.getRobotId(), board.getRobotOnPosition(new Position(2, 14)));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void robotsOnConveyorBeltsFacingTheSameEmptyTileDoesNotMove() {
|
||||
List<Robot> robots = new ArrayList<>();
|
||||
List<Player> players = new ArrayList<>();
|
||||
robots.add(new Robot(RobotID.ROBOT_1, new Position(8, 11)));
|
||||
robots.add(new Robot(RobotID.ROBOT_2, new Position(7, 10)));
|
||||
players.add(new Player(RobotID.ROBOT_1, "Player 1"));
|
||||
players.add(new Player(RobotID.ROBOT_2, "Player 2"));
|
||||
|
||||
try {
|
||||
board = BoardLoaderUtil.loadBoard("boards/test_board.txt", robots);
|
||||
Phase testPhase = new Phase(board, players, 0, null);
|
||||
testPhase.moveAllConveyorBelts();
|
||||
} catch (IOException | InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
assertEquals(RobotID.ROBOT_1, board.getRobotOnPosition(new Position(8, 11)));
|
||||
assertEquals(RobotID.ROBOT_2, board.getRobotOnPosition(new Position(7, 10)));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user