mirror of
https://github.com/inf112-v20/Fiasko.git
synced 2025-01-31 23:29:36 +01:00
Legger til test for at roboter som blir skubbet i hull av transportbånd dør
Co-Authored-By: gabrielmagnus <gabrielmagnus@users.noreply.github.com>
This commit is contained in:
parent
f9fc0507fb
commit
c969a3db04
@ -314,4 +314,25 @@ public class PhaseTest {
|
|||||||
int elapsedTime = (int) Math.floor((System.currentTimeMillis() - startTime) / 1000f);
|
int elapsedTime = (int) Math.floor((System.currentTimeMillis() - startTime) / 1000f);
|
||||||
assertTrue(elapsedTime < 1);
|
assertTrue(elapsedTime < 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void robotOnConveyorBeltFacingHoleMovesAndDies() {
|
||||||
|
List<Robot> robots = new ArrayList<>();
|
||||||
|
List<Player> players = new ArrayList<>();
|
||||||
|
robots.add(new Robot(RobotID.ROBOT_1, new Position(6, 7)));
|
||||||
|
players.add(new Player(RobotID.ROBOT_1, "Player 1"));
|
||||||
|
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
assertFalse(board.isRobotAlive(RobotID.ROBOT_1));
|
||||||
|
assertNull(board.getRobotOnPosition(new Position(6, 7)));
|
||||||
|
assertNull(board.getRobotOnPosition(new Position(7, 7)));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user