summaryrefslogtreecommitdiffstats
path: root/test/jrummikub/model/GameStateTest.java
blob: 5a55aefc82c50e953608eb26cb8816cc7e9dd391 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package jrummikub.model;

import static org.junit.Assert.*;

import java.awt.Color;

import org.junit.Before;
import org.junit.Test;
/** 
 * Test class for {@link GameState}
 */
public class GameStateTest {
	private IGameState testGame;

	/** */
	@Before
	public void createGame() {
		testGame = new GameState();
	}

	/** */
	@Test
	public void nextActiveTest() {
		// All there?
		assertEquals(4, testGame.getPlayerCount());
		assertSame(Color.red, testGame.getActivePlayer().getColor());
		testGame.nextPlayer();
		assertSame(Color.yellow, testGame.getActivePlayer().getColor());
		testGame.nextPlayer();
		testGame.nextPlayer();
		testGame.nextPlayer();
		assertSame(Color.red, testGame.getActivePlayer().getColor());
	}
	
}