This repository has been archived on 2025-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
JRummikub/test/jrummikub/model/RoundStateTest.java

36 lines
750 B
Java
Raw Normal View History

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 IRoundState testGame;
/** */
@Before
public void createGame() {
testGame = new RoundState(new GameSettings());
}
/** */
@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());
}
}