summaryrefslogtreecommitdiffstats
path: root/test/jrummikub
diff options
context:
space:
mode:
authorJannis Harder <harder@informatik.uni-luebeck.de>2011-06-17 17:41:53 +0200
committerJannis Harder <harder@informatik.uni-luebeck.de>2011-06-17 17:41:53 +0200
commit5ae0590dbc7c3e924941ad2269f8b42ed418d962 (patch)
treed54244ca18c7c96bc8cd4b975cd86555519c7119 /test/jrummikub
parente06ba8ea1346e5045a34508648ac93150aacb01a (diff)
downloadJRummikub-5ae0590dbc7c3e924941ad2269f8b42ed418d962.tar
JRummikub-5ae0590dbc7c3e924941ad2269f8b42ed418d962.zip
Testcase for NoLimits initial meld possible test
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@444 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'test/jrummikub')
-rw-r--r--test/jrummikub/model/HandTest.java15
1 files changed, 14 insertions, 1 deletions
diff --git a/test/jrummikub/model/HandTest.java b/test/jrummikub/model/HandTest.java
index 88ef463..f0be046 100644
--- a/test/jrummikub/model/HandTest.java
+++ b/test/jrummikub/model/HandTest.java
@@ -20,11 +20,13 @@ import org.junit.Test;
public class HandTest {
IHand hand;
+ GameSettings settings;
/** */
@Before
public void setUp() {
hand = new Hand();
+ settings = new GameSettings();
}
/** */
@@ -141,7 +143,7 @@ public class HandTest {
private void testInitialMeld(boolean possible, List<Stone> handStones) {
dropStoneList(handStones);
- assertTrue(possible == hand.isInitialMeldPossible(new GameSettings()));
+ assertTrue(possible == hand.isInitialMeldPossible(settings));
}
/** */
@@ -246,6 +248,16 @@ public class HandTest {
/** */
@Test
+ public void testNoLimits() {
+ testInitialMeld(false, Arrays.asList(new Stone(12, RED), new Stone(13,
+ RED), new Stone(1, RED), new Stone(2, RED), new Stone(3, RED)));
+ settings.setNoLimits(true);
+ testInitialMeld(true, Arrays.asList(new Stone(12, RED), new Stone(13,
+ RED), new Stone(1, RED), new Stone(2, RED), new Stone(3, RED)));
+ }
+
+ /** */
+ @Test
public void testCountIdenticalStones() {
dropStoneList(Arrays.asList(new Stone(1, RED), new Stone(2, RED),
new Stone(1, BLUE)));
@@ -266,4 +278,5 @@ public class HandTest {
assertEquals(0, hand.getIdenticalStoneCount());
}
+
}