diff options
-rw-r--r-- | backend/src/test/java/org/luxons/sevenwonders/game/cards/RequirementsTest.java | 9 | ||||
-rw-r--r-- | backend/src/test/java/org/luxons/sevenwonders/game/test/TestUtils.java | 7 |
2 files changed, 9 insertions, 7 deletions
diff --git a/backend/src/test/java/org/luxons/sevenwonders/game/cards/RequirementsTest.java b/backend/src/test/java/org/luxons/sevenwonders/game/cards/RequirementsTest.java index db8a016a..b46a5bb9 100644 --- a/backend/src/test/java/org/luxons/sevenwonders/game/cards/RequirementsTest.java +++ b/backend/src/test/java/org/luxons/sevenwonders/game/cards/RequirementsTest.java @@ -9,7 +9,6 @@ import org.junit.runner.RunWith; import org.luxons.sevenwonders.game.api.Table; import org.luxons.sevenwonders.game.boards.Board; import org.luxons.sevenwonders.game.resources.ResourceType; -import org.luxons.sevenwonders.game.resources.Resources; import org.luxons.sevenwonders.game.test.TestUtils; import static org.junit.Assert.assertEquals; @@ -44,9 +43,7 @@ public class RequirementsTest { @Theory public void resourceRequirement_initialResource(ResourceType initialResource, ResourceType requiredResource) { - Resources resources = TestUtils.createResources(requiredResource); - Requirements requirements = new Requirements(); - requirements.setResources(resources); + Requirements requirements = TestUtils.createRequirements(requiredResource); Board board = TestUtils.createBoard(initialResource, 0); Table table = new Table(Collections.singletonList(board)); @@ -64,9 +61,7 @@ public class RequirementsTest { ResourceType requiredResource) { assumeTrue(initialResource != requiredResource); - Resources resources = TestUtils.createResources(requiredResource); - Requirements requirements = new Requirements(); - requirements.setResources(resources); + Requirements requirements = TestUtils.createRequirements(requiredResource); Board board = TestUtils.createBoard(initialResource, 0); board.getProduction().addFixedResource(producedResource, 1); diff --git a/backend/src/test/java/org/luxons/sevenwonders/game/test/TestUtils.java b/backend/src/test/java/org/luxons/sevenwonders/game/test/TestUtils.java index a206cfb8..08cb10e8 100644 --- a/backend/src/test/java/org/luxons/sevenwonders/game/test/TestUtils.java +++ b/backend/src/test/java/org/luxons/sevenwonders/game/test/TestUtils.java @@ -108,6 +108,13 @@ public class TestUtils { return boughtResources; } + public static Requirements createRequirements(ResourceType... types) { + Resources resources = createResources(types); + Requirements requirements = new Requirements(); + requirements.setResources(resources); + return requirements; + } + public static List<Card> createSampleCards(int fromIndex, int nbCards) { List<Card> sampleCards = new ArrayList<>(); for (int i = fromIndex; i < fromIndex + nbCards; i++) { |