summaryrefslogtreecommitdiffstats
path: root/test/jrummikub/model/RoundStateTest.java
blob: 515161b18ebbff9e92bc54132f29280c5629b03b (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
36
37
38
39
40
41
42
43
package jrummikub.model;

import static org.junit.Assert.*;

import java.awt.Color;

import org.junit.Before;
import org.junit.Test;

/**
 * Test class for {@link RoundState}
 */
public class RoundStateTest {
	private GameSettings settings = new GameSettings();
	private IRoundState testRound;

	/** */
	@Before
	public void createRound() {
		settings.getPlayerList().add(new PlayerSettings("Player 1", Color.RED));
		settings.getPlayerList().add(new PlayerSettings("Player 2", Color.YELLOW));
		settings.getPlayerList().add(new PlayerSettings("Player 3", Color.BLUE));

		testRound = new RoundState(settings, null);
	}

	/** */
	@Test
	public void nextActiveTest() {
		// All there?
		assertEquals(settings.getPlayerList().size(), testRound.getPlayerCount());
		assertSame(Color.RED, testRound.getActivePlayer().getPlayerSettings()
				.getColor());
		testRound.nextPlayer();
		assertSame(Color.YELLOW, testRound.getActivePlayer().getPlayerSettings()
				.getColor());
		testRound.nextPlayer();
		testRound.nextPlayer();
		assertSame(Color.RED, testRound.getActivePlayer().getPlayerSettings()
				.getColor());
	}

}