diff options
Diffstat (limited to 'test/jrummikub/control/TurnControlTest.java')
-rw-r--r-- | test/jrummikub/control/TurnControlTest.java | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/test/jrummikub/control/TurnControlTest.java b/test/jrummikub/control/TurnControlTest.java index 4d6d0c2..197623e 100644 --- a/test/jrummikub/control/TurnControlTest.java +++ b/test/jrummikub/control/TurnControlTest.java @@ -34,6 +34,9 @@ import jrummikub.view.MockView; import org.junit.Before; import org.junit.Test; +/** + * Tests for {@link TurnControl} + */ public class TurnControlTest { static class AccessibleTable extends Table { StoneSet[] getSetArray() { @@ -93,6 +96,7 @@ public class TurnControlTest { assertFalse(stoneSetsModel.hasNext()); } + /** */ @Before public void setUp() { mockView = new MockView(); @@ -102,6 +106,7 @@ public class TurnControlTest { testControl = new TurnControl(mockHand, mockTable, mockView, mockTimer); } + /** */ @Test public void startTimer() { testControl.startTurn(); @@ -109,6 +114,7 @@ public class TurnControlTest { assertTrue(mockTimer.timerRunning); } + /** */ @SuppressWarnings("unchecked") @Test public void showInitialHand() { @@ -134,6 +140,7 @@ public class TurnControlTest { assertFalse(mockView.displayStartTurnPanel); } + /** */ @Test public void viewEndOfTurn() { testControl.startTurn(); @@ -156,6 +163,7 @@ public class TurnControlTest { assertTrue(mockView.playerPanel.endTurnEvent.listeners.isEmpty()); } + /** */ @Test public void timerEndOfTurn() { testControl.startTurn(); @@ -177,6 +185,7 @@ public class TurnControlTest { assertFalse(mockTimer.timerRunning); } + /** */ @Test public void deselctOnEndOfTurn() { testControl.startTurn(); @@ -190,6 +199,7 @@ public class TurnControlTest { assertCollection(new ArrayList<Stone>()); } + /** */ @Test public void selectStoneInHand() { testControl.startTurn(); @@ -209,6 +219,7 @@ public class TurnControlTest { } + /** */ @Test public void collectStoneInHand() { testControl.startTurn(); @@ -232,6 +243,7 @@ public class TurnControlTest { assertCollection(Arrays.asList(secondStone)); } + /** */ @Test public void deselectStoneInCollection() { testControl.startTurn(); @@ -248,6 +260,7 @@ public class TurnControlTest { assertCollection(Arrays.asList(secondStone)); } + /** */ @Test public void reorderCollection() { testControl.startTurn(); @@ -264,6 +277,7 @@ public class TurnControlTest { assertCollection(Arrays.asList(secondStone, firstStone)); } + /** */ @Test public void deselectWholeCollection() { testControl.startTurn(); @@ -283,6 +297,7 @@ public class TurnControlTest { assertCollection(new ArrayList<Stone>()); } + /** */ @Test public void selectStoneOnTable() { testControl.startTurn(); @@ -302,6 +317,7 @@ public class TurnControlTest { } + /** */ @Test public void collectStoneOnTable() { testControl.startTurn(); @@ -325,6 +341,7 @@ public class TurnControlTest { assertCollection(Arrays.asList(secondStone)); } + /** */ @Test public void selectSetOnTable() { testControl.startTurn(); @@ -347,6 +364,7 @@ public class TurnControlTest { assertCollection(Arrays.asList(stone3, stone4)); } + /** */ @Test public void collectSetOnTable() { testControl.startTurn(); @@ -369,6 +387,7 @@ public class TurnControlTest { assertCollection(Arrays.asList(stone1, stone2, stone3, stone4)); } + /** */ @Test public void rangeSelectOnTableReverse() { testControl.startTurn(); @@ -389,6 +408,7 @@ public class TurnControlTest { } + /** */ @Test public void rangeSelectOnTable() { testControl.startTurn(); @@ -409,6 +429,7 @@ public class TurnControlTest { } + /** */ @Test public void rangeCollectOnTable() { testControl.startTurn(); @@ -432,6 +453,7 @@ public class TurnControlTest { assertCollection(Arrays.asList(extraStone, stone1, stone2, stone3)); } + /** */ @Test public void rangeFailSelect() { testControl.startTurn(); @@ -456,6 +478,7 @@ public class TurnControlTest { } + /** */ @Test public void rangeFailCollect() { testControl.startTurn(); @@ -479,6 +502,7 @@ public class TurnControlTest { assertCollection(Arrays.asList(stone1, stone2)); } + /** */ @Test public void rangeSelectOnHandReverse() { testControl.startTurn(); @@ -498,6 +522,7 @@ public class TurnControlTest { assertCollection(Arrays.asList(stone1, stone2, stone3)); } + /** */ @Test public void rangeSelectOnHand() { testControl.startTurn(); @@ -517,6 +542,7 @@ public class TurnControlTest { assertCollection(Arrays.asList(stone1, stone2, stone3)); } + /** */ @Test public void rangeCollectOnHand() { testControl.startTurn(); @@ -539,6 +565,7 @@ public class TurnControlTest { assertCollection(Arrays.asList(extraStone, stone1, stone2, stone3)); } + /** */ @Test public void rangeFailSelectHand() { testControl.startTurn(); @@ -560,6 +587,7 @@ public class TurnControlTest { } + /** */ @Test public void rangeFailCollectHand() { testControl.startTurn(); @@ -587,6 +615,7 @@ public class TurnControlTest { assertEquals(expectedStones, selectedStones); } + /** */ @Test public void testAddLeft() { AccessibleTable table = new AccessibleTable(); @@ -703,6 +732,7 @@ public class TurnControlTest { assertSame(newSet2.get(5), blackFive); } + /** */ @Test public void testAddRight() { AccessibleTable table = new AccessibleTable(); @@ -819,6 +849,7 @@ public class TurnControlTest { assertSame(newSet2.get(5), redThree); } + /** */ @Test public void testAddNewSet() { AccessibleTable table = new AccessibleTable(); @@ -908,7 +939,7 @@ public class TurnControlTest { checkTableDisplay(table); checkHandDisplay(mockHand); } - + /** */ @Test public void testSortByGroups() { testControl.startTurn(); @@ -969,6 +1000,7 @@ public class TurnControlTest { checkHandDisplay(mockHand); } + /** */ @Test public void testSortByRuns() { testControl.startTurn(); @@ -1029,6 +1061,7 @@ public class TurnControlTest { checkHandDisplay(mockHand); } + /** */ @Test public void testDropHandValid() { testControl.startTurn(); @@ -1056,7 +1089,7 @@ public class TurnControlTest { } assertEquals(expected, handStones); } - + /** */ @Test public void testDropHandInvalid() { testControl.startTurn(); |