Test für den GameState fertig
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@91 72836036-5685-4462-b002-a69064685172
This commit is contained in:
parent
7b8732714d
commit
cbd8737a6a
1 changed files with 26 additions and 1 deletions
|
@ -1,5 +1,30 @@
|
||||||
package jrummikub.model;
|
package jrummikub.model;
|
||||||
|
|
||||||
public class GameStateTest {
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
|
|
||||||
|
import org.junit.Before;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
public class GameStateTest {
|
||||||
|
private GameState testGame;
|
||||||
|
|
||||||
|
@Before
|
||||||
|
public void createGame() {
|
||||||
|
testGame = new GameState();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void nextActiveTest() {
|
||||||
|
// All there?
|
||||||
|
assertEquals(4, testGame.players.size());
|
||||||
|
assertSame(Color.red, testGame.activePlayer().getColor());
|
||||||
|
testGame.nextPlayer();
|
||||||
|
assertSame(Color.blue, testGame.activePlayer().getColor());
|
||||||
|
testGame.nextPlayer();
|
||||||
|
testGame.nextPlayer();
|
||||||
|
testGame.nextPlayer();
|
||||||
|
assertSame(Color.red, testGame.activePlayer().getColor());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue