summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorjbion <joffrey.bion@amadeus.com>2016-12-25 14:57:41 +0100
committerjbion <joffrey.bion@amadeus.com>2016-12-25 14:58:06 +0100
commit1cb84124da0d3d238e44af77b6cba508eb734986 (patch)
tree029b301ea511673c6c269e175353b6a55d0ef24e /src/test
parentTake into account boughtResources in move validation (diff)
downloadseven-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')
-rw-r--r--src/test/java/org/luxons/sevenwonders/game/effects/BonusPerBoardElementTest.java8
-rw-r--r--src/test/java/org/luxons/sevenwonders/game/effects/MilitaryReinforcementsTest.java4
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
bgstack15