summaryrefslogtreecommitdiffstats
path: root/test/jrummikub/model/StoneHeapTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'test/jrummikub/model/StoneHeapTest.java')
-rw-r--r--test/jrummikub/model/StoneHeapTest.java27
1 files changed, 15 insertions, 12 deletions
diff --git a/test/jrummikub/model/StoneHeapTest.java b/test/jrummikub/model/StoneHeapTest.java
index 811a2d1..f0b88d3 100644
--- a/test/jrummikub/model/StoneHeapTest.java
+++ b/test/jrummikub/model/StoneHeapTest.java
@@ -1,8 +1,8 @@
package jrummikub.model;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
-import java.util.EnumSet;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -20,8 +20,10 @@ import org.junit.runner.RunWith;
@RunWith(Theories.class)
public class StoneHeapTest {
- private static Pair<GameSettings, StoneHeap> createHeap(GameSettings settings) {
- return new Pair<GameSettings, StoneHeap>(settings, new StoneHeap(settings));
+ private static Pair<GameSettings, StoneHeap> createHeap(
+ GameSettings settings) {
+ return new Pair<GameSettings, StoneHeap>(settings, new StoneHeap(
+ settings));
}
/**
@@ -54,7 +56,8 @@ public class StoneHeapTest {
private int calculateTotalNumberOfStones(GameSettings testSettings) {
int totalStones = testSettings.getHighestCard()
* testSettings.getStoneSetNumber()
- * testSettings.getStoneColors().size() + testSettings.getJokerNumber();
+ * testSettings.getStoneColors().size()
+ + testSettings.getJokerNumber();
return totalStones;
}
@@ -62,7 +65,7 @@ public class StoneHeapTest {
* Is the right number of Stones in heap?
*
* @param data
- * data
+ * data
*/
@Theory
public void fullStoneHeap(Pair<GameSettings, StoneHeap> data) {
@@ -74,14 +77,14 @@ public class StoneHeapTest {
* Enough stones of each color in heap?
*
* @param data
- * data
+ * data
*/
@Theory
public void fullColor(Pair<GameSettings, StoneHeap> data) {
int stonesOfAColor = data.getFirst().getHighestCard()
* data.getFirst().getStoneSetNumber();
Map<StoneColor, Integer> counters = new HashMap<StoneColor, Integer>();
- for (StoneColor c : EnumSet.allOf(StoneColor.class)) {
+ for (StoneColor c : data.getFirst().getStoneColors()) {
counters.put(c, 0);
}
for (Stone i : data.getSecond().heap) {
@@ -90,7 +93,7 @@ public class StoneHeapTest {
int count = counters.get(i.getColor());
counters.put(i.getColor(), count + 1);
}
- for (StoneColor c : EnumSet.allOf(StoneColor.class)) {
+ for (StoneColor c : data.getFirst().getStoneColors()) {
assertEquals(stonesOfAColor, (long) counters.get(c));
}
}
@@ -99,7 +102,7 @@ public class StoneHeapTest {
* Enough Jokers?
*
* @param data
- * data
+ * data
*/
@Theory
public void fullJoker(Pair<GameSettings, StoneHeap> data) {
@@ -113,7 +116,7 @@ public class StoneHeapTest {
/**
* @param data
- * data
+ * data
*/
@Theory
public void drawStoneTest(Pair<GameSettings, StoneHeap> data) {
@@ -124,7 +127,7 @@ public class StoneHeapTest {
/**
* @param data
- * data
+ * data
*/
@Theory
public void drawStonesTest(Pair<GameSettings, StoneHeap> data) {