Testcase for NoLimits initial meld possible test
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@444 72836036-5685-4462-b002-a69064685172
This commit is contained in:
parent
e06ba8ea13
commit
5ae0590dbc
1 changed files with 14 additions and 1 deletions
|
@ -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));
|
||||
}
|
||||
|
||||
/** */
|
||||
|
@ -244,6 +246,16 @@ public class HandTest {
|
|||
new Stone(11, BLUE), new Stone(RED)));
|
||||
}
|
||||
|
||||
/** */
|
||||
@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() {
|
||||
|
@ -266,4 +278,5 @@ public class HandTest {
|
|||
assertEquals(0, hand.getIdenticalStoneCount());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Reference in a new issue