summaryrefslogtreecommitdiff
path: root/backend/src/test
diff options
context:
space:
mode:
authorJoffrey BION <joffrey.bion@gmail.com>2017-05-16 21:13:36 +0200
committerJoffrey BION <joffrey.bion@gmail.com>2017-05-16 21:13:36 +0200
commit16a7dc9013ea7014e88bc118af3ad78b91dcb8b5 (patch)
tree7d3f773fa69ba91b9527108a8111c2af18e9e03a /backend/src/test
parentImprove assertions in HomeControllerTest (diff)
downloadseven-wonders-16a7dc9013ea7014e88bc118af3ad78b91dcb8b5.tar.gz
seven-wonders-16a7dc9013ea7014e88bc118af3ad78b91dcb8b5.tar.bz2
seven-wonders-16a7dc9013ea7014e88bc118af3ad78b91dcb8b5.zip
Add test for Requirements coverage
Diffstat (limited to 'backend/src/test')
-rw-r--r--backend/src/test/java/org/luxons/sevenwonders/game/cards/RequirementsTest.java17
1 files changed, 17 insertions, 0 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 1b1607d4..b01f9002 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
@@ -3,6 +3,7 @@ package org.luxons.sevenwonders.game.cards;
import java.util.Arrays;
import java.util.Collections;
+import org.junit.Test;
import org.junit.experimental.theories.DataPoints;
import org.junit.experimental.theories.Theories;
import org.junit.experimental.theories.Theory;
@@ -12,10 +13,12 @@ import org.luxons.sevenwonders.game.boards.Board;
import org.luxons.sevenwonders.game.resources.BoughtResources;
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.test.TestUtils;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeTrue;
@@ -32,6 +35,20 @@ public class RequirementsTest {
return ResourceType.values();
}
+ @Test
+ public void getResources_emptyAfterInit() throws Exception {
+ Requirements requirements = new Requirements();
+ assertTrue(requirements.getResources().isEmpty());
+ }
+
+ @Test
+ public void setResources_success() throws Exception {
+ Requirements requirements = new Requirements();
+ Resources resources = new Resources();
+ requirements.setResources(resources);
+ assertSame(resources, requirements.getResources());
+ }
+
@Theory
public void goldRequirement(int boardGold, int requiredGold) {
Requirements requirements = new Requirements();
bgstack15