Test für Austeilen geschrieben, eine Menge getSize hinzugefügt
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@116 72836036-5685-4462-b002-a69064685172
This commit is contained in:
parent
8e32bc9e69
commit
6e9c1b539b
7 changed files with 84 additions and 27 deletions
24
test/jrummikub/control/RoundControlTest.java
Normal file
24
test/jrummikub/control/RoundControlTest.java
Normal file
|
@ -0,0 +1,24 @@
|
|||
package jrummikub.control;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import jrummikub.model.GameState;
|
||||
import jrummikub.view.MockView;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class RoundControlTest {
|
||||
|
||||
@Test
|
||||
public void testDeal() {
|
||||
MockView view = new MockView();
|
||||
GameState testGameState = new GameState();
|
||||
RoundControl testRound = new RoundControl(testGameState, view);
|
||||
testRound.deal();
|
||||
assertEquals(106 - testGameState.getPlayerCount() * 14, testGameState
|
||||
.getGameHeap().getSize());
|
||||
for (int i = 0; i < testGameState.getPlayerCount(); i++) {
|
||||
assertEquals(14, testGameState.getPlayer(i).getHand().getSize());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -18,13 +18,13 @@ public class GameStateTest {
|
|||
@Test
|
||||
public void nextActiveTest() {
|
||||
// All there?
|
||||
assertEquals(4, testGame.players.size());
|
||||
assertSame(Color.red, testGame.activePlayer().getColor());
|
||||
assertEquals(4, testGame.getPlayerCount());
|
||||
assertSame(Color.red, testGame.getActivePlayer().getColor());
|
||||
testGame.nextPlayer();
|
||||
assertSame(Color.yellow, testGame.activePlayer().getColor());
|
||||
assertSame(Color.yellow, testGame.getActivePlayer().getColor());
|
||||
testGame.nextPlayer();
|
||||
testGame.nextPlayer();
|
||||
testGame.nextPlayer();
|
||||
assertSame(Color.red, testGame.activePlayer().getColor());
|
||||
assertSame(Color.red, testGame.getActivePlayer().getColor());
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue