Endret små feil i Board og Robot

Laget også test for board
This commit is contained in:
Steinar Aalstad Lillesund
2020-02-25 15:48:34 +01:00
parent bac6645342
commit b7e349eb3f
3 changed files with 25 additions and 2 deletions

View File

@ -94,4 +94,12 @@ public class BoardTest {
robotList.add(robot);
new Board(tileGrid, wallGrid, robotList);
}
@Test
public void killRobotReducesAmountOfLivesByOne () {
Robot robot = board.getAliveRobots().get(0);
for (int i = 0; i < 3; i++) {
board.moveRobot(robot.getRobotId(), Direction.SOUTH);
}
assertEquals(2, robot.getAmountOfLives());
}
}