Conflicts:
	src/test/java/inf112/fiasko/roborally/objects/PhaseTest.java
This commit is contained in:
Steinar Aalstad Lillesund 2020-04-20 16:58:32 +02:00
commit 0e3245f721
2 changed files with 21 additions and 0 deletions

View File

@ -67,6 +67,24 @@ public class PhaseTest {
assertEquals(RobotID.ROBOT_1, board.getRobotOnPosition(robot1Position));
}
@Test
public void playerWinsAfterTouchingAllFlagsInCorrectOrder() {
FakeGame testGame = new FakeGame();
List<Robot> robot = new ArrayList<>();
List<Player> player = new ArrayList<>();
robot.add(new Robot(RobotID.ROBOT_1, new Position(0,0)));
player.add(new Player(RobotID.ROBOT_1, "Player 1"));
try {
board = BoardLoaderUtil.loadBoard("boards/win_test_board.txt", robot);
Phase testPhase = new Phase(board, player, 0, testGame);
testPhase.checkAllFlags();
assertEquals("Player 1", testGame.getWinningPlayerName());
} catch (IOException e) {
e.printStackTrace();
}
}
@Test
public void robotRegistersFlagWhenOnCorrectOne() {
assertEquals(robot3.getLastFlagVisited(), 0);

View File

@ -0,0 +1,3 @@
1 1
17;1
0