|
|
@ -5,6 +5,8 @@ import org.junit.jupiter.api.AfterEach; |
|
|
|
import org.junit.jupiter.api.BeforeEach; |
|
|
|
import org.junit.jupiter.api.Test; |
|
|
|
|
|
|
|
import java.util.Arrays; |
|
|
|
|
|
|
|
import static org.junit.jupiter.api.Assertions.*; |
|
|
|
|
|
|
|
class BoardTest { |
|
|
@ -34,6 +36,17 @@ class BoardTest { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
void setCellState() { |
|
|
|
Board.State[] lastBoard = Arrays.copyOf(board.getStates(), board.getStates().length); |
|
|
|
board.setCellState(1, true); |
|
|
|
assertFalse(Arrays.equals(lastBoard, board.getStates())); |
|
|
|
assertEquals(board.getStates()[0], Board.State.CROSS); |
|
|
|
board.setCellState(1, false); |
|
|
|
assertEquals(board.getStates()[0], Board.State.CROSS); |
|
|
|
board.setCellState(2, false); |
|
|
|
assertEquals(board.getStates()[1], Board.State.CIRCLE); |
|
|
|
} |
|
|
|
|
|
|
|
@SuppressWarnings("AssertBetweenInconvertibleTypes") |
|
|
|
@Test |
|
|
|