summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorBennet Gerlach <bennet_gerlach@web.de>2011-05-05 01:33:58 +0200
committerBennet Gerlach <bennet_gerlach@web.de>2011-05-05 01:33:58 +0200
commit121afdf6c6341cb04a91d47db0c2fc477ccd84da (patch)
tree59120a67a8d1f626ce734c73ae245031e389273d /test
parent866197f315c166ba4085a488b4b95a804506eef4 (diff)
downloadJRummikub-121afdf6c6341cb04a91d47db0c2fc477ccd84da.tar
JRummikub-121afdf6c6341cb04a91d47db0c2fc477ccd84da.zip
Implemented stone display in both controls, tested (weniger Mock-Mist)
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@140 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'test')
-rw-r--r--test/jrummikub/control/RoundControlTest.java23
-rw-r--r--test/jrummikub/view/MockTablePanel.java5
2 files changed, 14 insertions, 14 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();
diff --git a/test/jrummikub/view/MockTablePanel.java b/test/jrummikub/view/MockTablePanel.java
index 151cc7e..c32946f 100644
--- a/test/jrummikub/view/MockTablePanel.java
+++ b/test/jrummikub/view/MockTablePanel.java
@@ -21,7 +21,7 @@ public class MockTablePanel implements ITablePanel {
public String leftPlayerName;
public String topPlayerName;
public String rightPlayerName;
-
+
public Iterable<Pair<StoneSet, Position>> stoneSets;
@Override
@@ -65,8 +65,7 @@ public class MockTablePanel implements ITablePanel {
@Override
public void setStoneSets(Iterable<Pair<StoneSet, Position>> stoneSets) {
- // TODO Auto-generated method stub
-
+ this.stoneSets = stoneSets;
}
@Override