summaryrefslogtreecommitdiffstats
path: root/test/jrummikub/control
diff options
context:
space:
mode:
Diffstat (limited to 'test/jrummikub/control')
-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));
}