summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/jrummikub/model/GameStateTest.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/jrummikub/model/GameStateTest.java b/test/jrummikub/model/GameStateTest.java
index 25987e9..7515e4d 100644
--- a/test/jrummikub/model/GameStateTest.java
+++ b/test/jrummikub/model/GameStateTest.java
@@ -1,5 +1,30 @@
package jrummikub.model;
+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());
+ }
}