summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJannis Harder <harder@informatik.uni-luebeck.de>2011-05-05 21:35:40 +0200
committerJannis Harder <harder@informatik.uni-luebeck.de>2011-05-05 21:35:40 +0200
commit95378380339da507fd737eec2cdffb750f83bbf9 (patch)
tree54625f6ab4a9e9ce1503b982d5864d9be8257a21
parent8cef7f0f9d6545034cc1451a33402a0d12a5071b (diff)
downloadJRummikub-95378380339da507fd737eec2cdffb750f83bbf9.tar
JRummikub-95378380339da507fd737eec2cdffb750f83bbf9.zip
Check deselecting of stones on end of turn
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@157 72836036-5685-4462-b002-a69064685172
-rw-r--r--test/jrummikub/control/TurnControlTest.java16
1 files changed, 15 insertions, 1 deletions
diff --git a/test/jrummikub/control/TurnControlTest.java b/test/jrummikub/control/TurnControlTest.java
index 6a37c67..27d9aec 100644
--- a/test/jrummikub/control/TurnControlTest.java
+++ b/test/jrummikub/control/TurnControlTest.java
@@ -118,6 +118,7 @@ public class TurnControlTest {
assertTrue(mockView.playerPanel.endTurnEvent.listeners.isEmpty());
}
+
@Test
public void timerEndOfTurn() {
eventFired = false;
@@ -138,6 +139,19 @@ public class TurnControlTest {
}
@Test
+ public void deselctOnEndOfTurn() {
+
+ Stone firstStone = new Stone(StoneColor.RED);
+
+ // Select first stone
+ mockView.playerPanel.handPanel.stoneClickEvent.emit(firstStone, false);
+ mockTimer.timeRunOutEvent.emit();
+
+ assertCollection(new ArrayList<Stone>());
+ }
+
+
+ @Test
public void selectStoneInHand() {
Stone firstStone = new Stone(StoneColor.RED);
@@ -386,6 +400,6 @@ public class TurnControlTest {
ArrayList<Stone> selectedStones = new ArrayList<Stone>(
mockView.selectedStones);
ArrayList<Stone> expectedStones = new ArrayList<Stone>(expected);
- assertEquals(selectedStones, expectedStones);
+ assertEquals(expectedStones, selectedStones);
}
}