diff options
author | Jannis Harder <harder@informatik.uni-luebeck.de> | 2011-05-04 19:08:14 +0200 |
---|---|---|
committer | Jannis Harder <harder@informatik.uni-luebeck.de> | 2011-05-04 19:08:14 +0200 |
commit | 8641164929f9c84bc927c656e81a15d948533009 (patch) | |
tree | 3ac0d42ae051f1c08d0b44693a7977286fed39d0 /test/jrummikub/control | |
parent | 20b7f250da1e9eea67908a35462221ab003f2a2e (diff) | |
download | JRummikub-8641164929f9c84bc927c656e81a15d948533009.tar JRummikub-8641164929f9c84bc927c656e81a15d948533009.zip |
stone collection tests done
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@114 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'test/jrummikub/control')
-rw-r--r-- | test/jrummikub/control/TurnControlTest.java | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/test/jrummikub/control/TurnControlTest.java b/test/jrummikub/control/TurnControlTest.java index 840e83f..60ff37f 100644 --- a/test/jrummikub/control/TurnControlTest.java +++ b/test/jrummikub/control/TurnControlTest.java @@ -2,6 +2,7 @@ package jrummikub.control; import static org.junit.Assert.*; +import java.util.Collections; import java.util.List; import java.util.ArrayList; import java.util.Arrays; @@ -146,10 +147,45 @@ public class TurnControlTest { mockView.playerPanel.handPanel.stoneClickEvent.emit(secondStone, true); mockView.tablePanel.stoneCollectionPanel.stoneClickEvent.emit( - firstStone, true); + firstStone, false); assertCollection(Arrays.asList(secondStone)); } + + @Test + public void reorderCollection() { + + TurnControl testControl = new TurnControl(null, null, mockView, + mockTimer); + Stone firstStone = new Stone(StoneColor.RED); + Stone secondStone = new Stone(StoneColor.BLACK); + + mockView.playerPanel.handPanel.stoneClickEvent.emit(firstStone, true); + mockView.playerPanel.handPanel.stoneClickEvent.emit(secondStone, true); + + mockView.tablePanel.stoneCollectionPanel.stoneClickEvent.emit( + firstStone, true); + + assertCollection(Arrays.asList(secondStone, firstStone)); + } + + @Test + public void deselectWholeCollection() { + + TurnControl testControl = new TurnControl(null, null, mockView, + mockTimer); + Stone firstStone = new Stone(StoneColor.RED); + Stone secondStone = new Stone(StoneColor.BLACK); + + mockView.playerPanel.handPanel.stoneClickEvent.emit(firstStone, true); + mockView.playerPanel.handPanel.stoneClickEvent.emit(secondStone, true); + + mockView.tablePanel.stoneCollectionPanel.setClickEvent.emit( + firstStone, true); + + assertCollection(new ArrayList<Stone>()); + } + private void assertCollection(List<Stone> expected) { ArrayList<Stone> selectedStones = new ArrayList<Stone>( |