summaryrefslogtreecommitdiffstats
path: root/test/jrummikub
diff options
context:
space:
mode:
Diffstat (limited to 'test/jrummikub')
-rw-r--r--test/jrummikub/control/TurnControlTest.java21
-rw-r--r--test/jrummikub/view/MockTablePanel.java7
2 files changed, 15 insertions, 13 deletions
diff --git a/test/jrummikub/control/TurnControlTest.java b/test/jrummikub/control/TurnControlTest.java
index 8c58352..8a2416f 100644
--- a/test/jrummikub/control/TurnControlTest.java
+++ b/test/jrummikub/control/TurnControlTest.java
@@ -21,7 +21,7 @@ import org.junit.Test;
public class TurnControlTest {
class MockTimer implements ITurnTimer {
- public boolean timerRunning;
+ public boolean timerRunning = false;
public Event timeRunOutEvent = new Event();
@Override
@@ -56,6 +56,11 @@ public class TurnControlTest {
}
@Test
+ public void startTimer() {
+ assertTrue(mockTimer.timerRunning);
+ }
+
+ @Test
public void viewEndOfTurn() {
eventFired = false;
mockTimer.timerRunning = true;
@@ -141,8 +146,8 @@ public class TurnControlTest {
mockView.playerPanel.handPanel.stoneClickEvent.emit(firstStone, true);
mockView.playerPanel.handPanel.stoneClickEvent.emit(secondStone, true);
- mockView.tablePanel.stoneCollectionPanel.stoneClickEvent.emit(
- firstStone, false);
+ mockView.tablePanel.stoneCollectionPanel.stoneClickEvent.emit(firstStone,
+ false);
assertCollection(Arrays.asList(secondStone));
}
@@ -156,8 +161,8 @@ public class TurnControlTest {
mockView.playerPanel.handPanel.stoneClickEvent.emit(firstStone, true);
mockView.playerPanel.handPanel.stoneClickEvent.emit(secondStone, true);
- mockView.tablePanel.stoneCollectionPanel.stoneClickEvent.emit(
- firstStone, true);
+ mockView.tablePanel.stoneCollectionPanel.stoneClickEvent.emit(firstStone,
+ true);
assertCollection(Arrays.asList(secondStone, firstStone));
}
@@ -262,8 +267,7 @@ public class TurnControlTest {
Stone stone2 = new Stone(2, StoneColor.RED);
Stone stone3 = new Stone(3, StoneColor.RED);
Stone stone4 = new Stone(4, StoneColor.RED);
- StoneSet set1 = new StoneSet(Arrays.asList(stone1, stone2, stone3,
- stone4));
+ StoneSet set1 = new StoneSet(Arrays.asList(stone1, stone2, stone3, stone4));
mockTable.findStoneSet.put(stone1, set1);
mockTable.findStoneSet.put(stone3, set1);
@@ -283,8 +287,7 @@ public class TurnControlTest {
Stone stone2 = new Stone(2, StoneColor.RED);
Stone stone3 = new Stone(3, StoneColor.RED);
Stone stone4 = new Stone(4, StoneColor.RED);
- StoneSet set1 = new StoneSet(Arrays.asList(stone1, stone2, stone3,
- stone4));
+ StoneSet set1 = new StoneSet(Arrays.asList(stone1, stone2, stone3, stone4));
mockTable.findStoneSet.put(stone1, set1);
mockTable.findStoneSet.put(stone3, set1);
diff --git a/test/jrummikub/view/MockTablePanel.java b/test/jrummikub/view/MockTablePanel.java
index 3fcc289..65842c2 100644
--- a/test/jrummikub/view/MockTablePanel.java
+++ b/test/jrummikub/view/MockTablePanel.java
@@ -9,20 +9,19 @@ import jrummikub.util.Event1;
import jrummikub.util.Event2;
import jrummikub.util.IEvent1;
import jrummikub.util.IEvent2;
+import jrummikub.util.Pair;
public class MockTablePanel implements ITablePanel {
public Event2<Stone, Boolean> stoneClickEvent = new Event2<Stone, Boolean>();
public Event2<Stone, Boolean> setClickEvent = new Event2<Stone, Boolean>();
public Event2<Stone, Boolean> rangeClickEvent = new Event2<Stone, Boolean>();
-
+
public MockStoneCollectionPanel stoneCollectionPanel = new MockStoneCollectionPanel();
public String leftPlayerName;
public String topPlayerName;
public String rightPlayerName;
-
-
@Override
public IEvent2<Stone, Boolean> getStoneClickEvent() {
// TODO Auto-generated method stub
@@ -63,7 +62,7 @@ public class MockTablePanel implements ITablePanel {
}
@Override
- public void setStoneSets(Map<StoneSet, Position> stoneSets) {
+ public void setStoneSets(Iterable<Pair<StoneSet, Position>> stoneSets) {
// TODO Auto-generated method stub
}