You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
796 B
39 lines
796 B
package Game.TicTacToe;
|
|
|
|
import Game.Tictactoe;
|
|
import org.junit.jupiter.api.AfterEach;
|
|
import org.junit.jupiter.api.BeforeEach;
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
import static org.junit.jupiter.api.Assertions.*;
|
|
|
|
class BoardTest {
|
|
|
|
Board board;
|
|
|
|
@BeforeEach
|
|
void setUp() {
|
|
board = new Board();
|
|
}
|
|
|
|
@AfterEach
|
|
void tearDown() {
|
|
}
|
|
|
|
@Test
|
|
void getStatedChar() {
|
|
assertEquals(Board.getStatedChar(Board.State.CIRCLE), 'O');
|
|
assertEquals(Board.getStatedChar(Board.State.CROSS), 'X');
|
|
assertEquals(Board.getStatedChar(Board.State.EMPTY), ' ');
|
|
}
|
|
|
|
@Test
|
|
void testForEmptyBoardOnInitialization() {
|
|
for (int i = 0; i < 9; i++) {
|
|
assertEquals(board.getStates()[i], Board.State.EMPTY);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|