summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorIda Massow <massow@informatik.uni-luebeck.de>2011-05-09 20:54:17 +0200
committerIda Massow <massow@informatik.uni-luebeck.de>2011-05-09 20:54:17 +0200
commit050ae5f2247ef073ad92b5ad084a4e3816f35da9 (patch)
tree126c100a4bf8371bfbb2c42adae662419f116dfe /test
parentfffca3fe9a1285dc3a9f009c3431cd907443b7af (diff)
downloadJRummikub-050ae5f2247ef073ad92b5ad084a4e3816f35da9.tar
JRummikub-050ae5f2247ef073ad92b5ad084a4e3816f35da9.zip
Angefangener Test für Hand-Steine-verschwinden-fix
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@194 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'test')
-rw-r--r--test/jrummikub/control/RoundControlTest.java30
1 files changed, 22 insertions, 8 deletions
diff --git a/test/jrummikub/control/RoundControlTest.java b/test/jrummikub/control/RoundControlTest.java
index 38060c0..f183505 100644
--- a/test/jrummikub/control/RoundControlTest.java
+++ b/test/jrummikub/control/RoundControlTest.java
@@ -49,7 +49,8 @@ public class RoundControlTest {
- testGameState.table.getSize(), testGameState.getGameHeap()
.getSize());
for (int i = 0; i < testGameState.getPlayerCount(); i++) {
- assertEquals(14, testGameState.getNthNextPlayer(i).getHand().getSize());
+ assertEquals(14, testGameState.getNthNextPlayer(i).getHand()
+ .getSize());
}
}
@@ -67,8 +68,8 @@ public class RoundControlTest {
private void checkTableDisplay() {
Iterator<Pair<StoneSet, Position>> stoneSetsView = view.tablePanel.stoneSets
.iterator();
- Iterator<Pair<StoneSet, Position>> stoneSetsModel = testGameState.table.clone().sets
- .iterator();
+ Iterator<Pair<StoneSet, Position>> stoneSetsModel = testGameState.table
+ .clone().sets.iterator();
while (stoneSetsView.hasNext()) {
assertTrue(stoneSetsModel.hasNext());
@@ -85,6 +86,17 @@ public class RoundControlTest {
view.displayStartTurnPanel = false;
}
+ // TODO hier weitermachen
+ @Test
+ public void testDealStone() {
+ testRound.deal();
+ checkCorrectlyDealed();
+ for (int i = 0; i < 28 - 14; i++) {
+ testRound.dealStone();
+ }
+ assertEquals(28, testGameState.getActivePlayer().getHand().getSize());
+ }
+
@Test
public void testDeal() {
testRound.deal();
@@ -136,7 +148,8 @@ public class RoundControlTest {
view.startTurnEvent.emit();
assertFalse(view.displayStartTurnPanel);
- Stone stone = testGameState.players.get(0).hand.stones.remove(0).getFirst();
+ Stone stone = testGameState.players.get(0).hand.stones.remove(0)
+ .getFirst();
newTable.drop(new StoneSet(stone), new Position(0, 0));
resetTurnStart();
view.getPlayerPanel().endTurnEvent.emit();
@@ -194,7 +207,8 @@ public class RoundControlTest {
view.startTurnEvent.emit();
assertFalse(view.displayStartTurnPanel);
- Stone stone = testGameState.players.get(0).hand.stones.remove(0).getFirst();
+ Stone stone = testGameState.players.get(0).hand.stones.remove(0)
+ .getFirst();
newTable.drop(new StoneSet(stone), new Position(0, 0));
testGameState.players.get(0).hand.stones.clear();
resetTurnStart();
@@ -224,13 +238,13 @@ public class RoundControlTest {
blueThree));
newTable.drop(newSet1, new Position(0, 0));
newTable.drop(newSet2, new Position(0, 0));
-
+
Set<Stone> expectedStones = new HashSet<Stone>();
expectedStones.add(blueThree);
expectedStones.add(blueFour);
-
+
Set<Stone> stones = RoundControl.tableDifference(oldTable, newTable);
-
+
assertTrue(expectedStones.containsAll(stones));
assertTrue(stones.containsAll(expectedStones));
}