summaryrefslogtreecommitdiffstats
path: root/test/jrummikub/control/RoundControlTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'test/jrummikub/control/RoundControlTest.java')
-rw-r--r--test/jrummikub/control/RoundControlTest.java23
1 files changed, 12 insertions, 11 deletions
diff --git a/test/jrummikub/control/RoundControlTest.java b/test/jrummikub/control/RoundControlTest.java
index caefb1f..caace50 100644
--- a/test/jrummikub/control/RoundControlTest.java
+++ b/test/jrummikub/control/RoundControlTest.java
@@ -9,7 +9,6 @@ import static org.junit.Assert.assertTrue;
import java.util.Iterator;
-import jrummikub.model.GameState;
import jrummikub.model.MockGameState;
import jrummikub.model.MockTable;
import jrummikub.model.Position;
@@ -35,13 +34,13 @@ public class RoundControlTest {
Stone stone = testGameState.getGameHeap().drawStone();
testGameState.table.drop(new StoneSet(stone), new Position(5, 0));
newTable = new MockTable();
- newTable.drop(new StoneSet(stone), new Position(5, 0));
-
+ newTable.sets.add(testGameState.table.sets.get(0));
+ testGameState.table.clonedTable = newTable;
}
private void checkCorrectlyDealed() {
- assertEquals(106 - testGameState.getPlayerCount() * 14 - testGameState.table.getSize(), testGameState
- .getGameHeap().getSize());
+ assertEquals(106 - testGameState.getPlayerCount() * 14
+ - testGameState.table.getSize(), testGameState.getGameHeap().getSize());
for (int i = 0; i < testGameState.getPlayerCount(); i++) {
assertEquals(14, testGameState.getPlayer(i).getHand().getSize());
}
@@ -56,12 +55,14 @@ public class RoundControlTest {
assertFalse(view.startTurnEvent.listeners.isEmpty());
checkTableDisplay();
}
-
+
private void checkTableDisplay() {
- Iterator<Pair<StoneSet, Position>> stoneSetsView = view.tablePanel.stoneSets.iterator();
- Iterator<Pair<StoneSet, Position>> stoneSetsModel = testGameState.table.sets.iterator();
-
- while(stoneSetsView.hasNext()) {
+ Iterator<Pair<StoneSet, Position>> stoneSetsView = view.tablePanel.stoneSets
+ .iterator();
+ Iterator<Pair<StoneSet, Position>> stoneSetsModel = testGameState.table.sets
+ .iterator();
+
+ while (stoneSetsView.hasNext()) {
assertTrue(stoneSetsModel.hasNext());
assertSame(stoneSetsView.next(), stoneSetsModel.next());
}
@@ -89,7 +90,7 @@ public class RoundControlTest {
checkTurnStartSetUp();
}
-
+
@Test
public void testTableDisplay() {
testRound.startRound();