mirror of
https://github.com/inf112-v20/Fiasko.git
synced 2025-03-03 16:49:45 +01:00
Parprogrammering med tobydrama - Laget Tester for registrering av flagg.
This commit is contained in:
parent
31bef9fe0b
commit
c43798dfab
@ -61,7 +61,26 @@ public class BoardTest {
|
||||
wallGrid.setElement(2, 1, new Wall(WallType.WALL_NORMAL, Direction.SOUTH));
|
||||
wallGrid.setElement(2, 2, new Wall(WallType.WALL_NORMAL, Direction.EAST));
|
||||
wallGrid.setElement(1, 2, new Wall(WallType.WALL_CORNER, Direction.NORTH_EAST));
|
||||
tileGrid.setElement(3,3, new Tile(TileType.FLAG_1, Direction.NORTH));
|
||||
tileGrid.setElement(2,2, new Tile(TileType.FLAG_2, Direction.NORTH));
|
||||
board = new Board(tileGrid, wallGrid, robotList);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void flagGetsUpdatedOnRobotWithCorrectLastVisitedFlag() {
|
||||
Robot testRobot = robotList.get(6);
|
||||
assertEquals(0,testRobot.getLastFlagVisited());
|
||||
board.updateFlagOnRobot(RobotID.ROBOT_7, TileType.FLAG_1);
|
||||
assertEquals(1,testRobot.getLastFlagVisited());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void flagDoesNotUpdatedOnRobotWithWringLastVisitedFlag() {
|
||||
Robot testRobot = robotList.get(6);
|
||||
assertEquals(0,testRobot.getLastFlagVisited());
|
||||
board.updateFlagOnRobot(RobotID.ROBOT_7, TileType.FLAG_2);
|
||||
assertEquals(0,testRobot.getLastFlagVisited());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Loading…
x
Reference in New Issue
Block a user