diff options
author | jbion <joffrey.bion@amadeus.com> | 2016-12-25 14:57:41 +0100 |
---|---|---|
committer | jbion <joffrey.bion@amadeus.com> | 2016-12-25 14:58:06 +0100 |
commit | 1cb84124da0d3d238e44af77b6cba508eb734986 (patch) | |
tree | 029b301ea511673c6c269e175353b6a55d0ef24e /src/test/java | |
parent | Take into account boughtResources in move validation (diff) | |
download | seven-wonders-1cb84124da0d3d238e44af77b6cba508eb734986.tar.gz seven-wonders-1cb84124da0d3d238e44af77b6cba508eb734986.tar.bz2 seven-wonders-1cb84124da0d3d238e44af77b6cba508eb734986.zip |
Extract military stuff into its own object
Diffstat (limited to 'src/test/java')
-rw-r--r-- | src/test/java/org/luxons/sevenwonders/game/effects/BonusPerBoardElementTest.java | 8 | ||||
-rw-r--r-- | src/test/java/org/luxons/sevenwonders/game/effects/MilitaryReinforcementsTest.java | 4 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/test/java/org/luxons/sevenwonders/game/effects/BonusPerBoardElementTest.java b/src/test/java/org/luxons/sevenwonders/game/effects/BonusPerBoardElementTest.java index c2c6f86d..5f42bc53 100644 --- a/src/test/java/org/luxons/sevenwonders/game/effects/BonusPerBoardElementTest.java +++ b/src/test/java/org/luxons/sevenwonders/game/effects/BonusPerBoardElementTest.java @@ -67,7 +67,9 @@ public class BonusPerBoardElementTest { @Theory public void computePoints_countsDefeatTokens(RelativeBoardPosition boardPosition, int nbDefeatTokens, int points, int gold) { Board board = table.getBoard(0, boardPosition); - board.setNbDefeatTokens(nbDefeatTokens); + for (int i = 0; i < nbDefeatTokens; i++) { + board.getMilitary().defeat(); + } BonusPerBoardElement bonus = createBonus(BoardElementType.DEFEAT_TOKEN, gold, points); bonus.setBoards(Collections.singletonList(boardPosition)); @@ -106,7 +108,9 @@ public class BonusPerBoardElementTest { @Theory public void apply_countsDefeatTokens(RelativeBoardPosition boardPosition, int nbDefeatTokens, int points, int gold) { Board board = table.getBoard(0, boardPosition); - board.setNbDefeatTokens(nbDefeatTokens); + for (int i = 0; i < nbDefeatTokens; i++) { + board.getMilitary().defeat(); + } BonusPerBoardElement bonus = createBonus(BoardElementType.DEFEAT_TOKEN, gold, points); bonus.setBoards(Collections.singletonList(boardPosition)); diff --git a/src/test/java/org/luxons/sevenwonders/game/effects/MilitaryReinforcementsTest.java b/src/test/java/org/luxons/sevenwonders/game/effects/MilitaryReinforcementsTest.java index fbfc2d6c..d3c2cc03 100644 --- a/src/test/java/org/luxons/sevenwonders/game/effects/MilitaryReinforcementsTest.java +++ b/src/test/java/org/luxons/sevenwonders/game/effects/MilitaryReinforcementsTest.java @@ -27,12 +27,12 @@ public class MilitaryReinforcementsTest { @Theory public void apply_increaseGoldWithRightAmount(int initialShields, int additionalShields, ResourceType type) { Board board = TestUtils.createBoard(type); - board.setNbWarSymbols(initialShields); + board.getMilitary().addShields(initialShields); MilitaryReinforcements reinforcements = new MilitaryReinforcements(additionalShields); reinforcements.apply(board); - assertEquals(initialShields + additionalShields, board.getNbWarSymbols()); + assertEquals(initialShields + additionalShields, board.getMilitary().getNbShields()); } @Theory |