git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@503 72836036-5685-4462-b002-a69064685172
43 lines
1.1 KiB
Java
43 lines
1.1 KiB
Java
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());
|
|
}
|
|
|
|
}
|