diff options
author | jbion <joffrey.bion@amadeus.com> | 2016-12-24 13:03:14 +0100 |
---|---|---|
committer | jbion <joffrey.bion@amadeus.com> | 2016-12-24 13:55:20 +0100 |
commit | 137a24ea77cab57454a4633dee59b720e2287dc7 (patch) | |
tree | 2d3ae250c99c94d7d8acf16b0bb53732c864f7ff /src | |
parent | Add test for relative board position accesses (diff) | |
download | seven-wonders-137a24ea77cab57454a4633dee59b720e2287dc7.tar.gz seven-wonders-137a24ea77cab57454a4633dee59b720e2287dc7.tar.bz2 seven-wonders-137a24ea77cab57454a4633dee59b720e2287dc7.zip |
Add minimal stages in test wonders
Diffstat (limited to 'src')
-rw-r--r-- | src/test/java/org/luxons/sevenwonders/game/test/TestUtils.java | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/test/java/org/luxons/sevenwonders/game/test/TestUtils.java b/src/test/java/org/luxons/sevenwonders/game/test/TestUtils.java index f92d4b99..9f4e712a 100644 --- a/src/test/java/org/luxons/sevenwonders/game/test/TestUtils.java +++ b/src/test/java/org/luxons/sevenwonders/game/test/TestUtils.java @@ -19,6 +19,7 @@ import org.luxons.sevenwonders.game.resources.Provider; import org.luxons.sevenwonders.game.resources.ResourceType; import org.luxons.sevenwonders.game.resources.Resources; import org.luxons.sevenwonders.game.wonders.Wonder; +import org.luxons.sevenwonders.game.wonders.WonderStage; public class TestUtils { @@ -47,7 +48,7 @@ public class TestUtils { public static Board createBoard(ResourceType initialResource) { Settings settings = new Settings(); - Wonder wonder = new Wonder("Test Wonder " + initialResource.getSymbol(), initialResource); + Wonder wonder = createWonder(initialResource); String userName = "testUser" + initialResource.getSymbol(); String displayName = "Test User " + initialResource.getSymbol(); @@ -73,7 +74,13 @@ public class TestUtils { } public static Wonder createWonder(ResourceType initialResource) { - return new Wonder("Test Wonder " + initialResource.getSymbol(), initialResource); + WonderStage stage1 = new WonderStage(); + stage1.setRequirements(new Requirements()); + WonderStage stage2 = new WonderStage(); + stage1.setRequirements(new Requirements()); + WonderStage stage3 = new WonderStage(); + stage1.setRequirements(new Requirements()); + return new Wonder("Test Wonder " + initialResource.getSymbol(), initialResource, stage1, stage2, stage3); } public static Production createFixedProduction(ResourceType... producedTypes) { @@ -101,11 +108,15 @@ public class TestUtils { public static List<Card> createSampleCards(int fromIndex, int nbCards) { List<Card> sampleCards = new ArrayList<>(); for (int i = fromIndex; i < fromIndex + nbCards; i++) { - sampleCards.add(new Card("Test Card " + i, Color.BLUE, new Requirements(), null, null, null, null)); + sampleCards.add(createCard(i, Color.BLUE)); } return sampleCards; } + public static Card createCard(int num, Color color) { + return new Card("Test Card " + num, color, new Requirements(), null, null, null, null); + } + public static ScienceProgress createScienceProgress(int compasses, int wheels, int tablets, int jokers) { ScienceProgress progress = new ScienceProgress(); progress.setScience(TestUtils.createScience(compasses, wheels, tablets, jokers)); |