summaryrefslogtreecommitdiff
path: root/backend/src/test/java
diff options
context:
space:
mode:
authorJoffrey BION <joffrey.bion@gmail.com>2017-05-10 07:39:03 +0200
committerJoffrey BION <joffrey.bion@gmail.com>2017-05-10 07:39:03 +0200
commit0ca787b3315e8074483895b428aaa1c84c3dc512 (patch)
treec6ccb778d045eb937a1e2d63c04ad4f15ce57840 /backend/src/test/java
parentRefac requirement-checking methods (diff)
downloadseven-wonders-0ca787b3315e8074483895b428aaa1c84c3dc512.tar.gz
seven-wonders-0ca787b3315e8074483895b428aaa1c84c3dc512.tar.bz2
seven-wonders-0ca787b3315e8074483895b428aaa1c84c3dc512.zip
Make BestPriceCalculator use the public production of the neighbours
It was incorrectly using the private production.
Diffstat (limited to 'backend/src/test/java')
-rw-r--r--backend/src/test/java/org/luxons/sevenwonders/game/resources/BestPriceCalculatorTest.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/backend/src/test/java/org/luxons/sevenwonders/game/resources/BestPriceCalculatorTest.java b/backend/src/test/java/org/luxons/sevenwonders/game/resources/BestPriceCalculatorTest.java
index ad1641c5..3706745d 100644
--- a/backend/src/test/java/org/luxons/sevenwonders/game/resources/BestPriceCalculatorTest.java
+++ b/backend/src/test/java/org/luxons/sevenwonders/game/resources/BestPriceCalculatorTest.java
@@ -42,7 +42,6 @@ public class BestPriceCalculatorTest {
Board opposite = TestUtils.createBoard(ResourceType.GLASS);
Table table = new Table(Arrays.asList(main, right, opposite, left));
-
Resources resources = new Resources();
resources.add(ResourceType.WOOD, 1);
assertEquals(1, BestPriceCalculator.bestPrice(resources, table, 0));
@@ -60,10 +59,10 @@ public class BestPriceCalculatorTest {
Board right = TestUtils.createBoard(ResourceType.ORE);
right.getProduction().addChoice(ResourceType.WOOD, ResourceType.CLAY);
+ right.getPublicProduction().addChoice(ResourceType.WOOD, ResourceType.CLAY);
Table table = new Table(Arrays.asList(main, right, left));
-
Resources resources = new Resources();
resources.add(ResourceType.WOOD, 1);
assertEquals(1, BestPriceCalculator.bestPrice(resources, table, 0));
@@ -82,6 +81,8 @@ public class BestPriceCalculatorTest {
Board right = TestUtils.createBoard(ResourceType.WOOD);
right.getProduction().addFixedResource(ResourceType.ORE, 1);
right.getProduction().addFixedResource(ResourceType.CLAY, 1);
+ right.getPublicProduction().addFixedResource(ResourceType.ORE, 1);
+ right.getPublicProduction().addFixedResource(ResourceType.CLAY, 1);
Table table = new Table(Arrays.asList(main, right, left));
bgstack15