package dev.kske.chess.board; import static org.junit.Assert.*; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import dev.kske.chess.board.Piece.Color; /** * Project: Chess
* File: BoardTest.java
* Created: 08.07.2019
* Author: Kai S. K. Engelbart */ class BoardTest { private Board board; /** * @throws java.lang.Exception */ @BeforeEach void setUp() throws Exception { board = new Board(); } /** * Test method for {@link Board#Board(Board, boolean)}. */ @Test void testClone() { Board clone = new Board(board, false); assertNotSame(clone, board); assertNotSame(clone.getBoardArr(), board.getBoardArr()); clone.getBoardArr()[0][0] = new Queen(Color.BLACK, clone); clone.move(new Move(1, 1, 1, 2)); assertNotEquals(clone.getBoardArr()[0][0], board.getBoardArr()[0][0]); assertNotEquals( clone.getLog().getActiveColor(), board.getLog().getActiveColor() ); } }