46 lines
1.0 KiB
Java
46 lines
1.0 KiB
Java
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: <strong>Chess</strong><br>
|
|
* File: <strong>BoardTest.java</strong><br>
|
|
* Created: <strong>08.07.2019</strong><br>
|
|
* Author: <strong>Kai S. K. Engelbart</strong>
|
|
*/
|
|
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()
|
|
);
|
|
}
|
|
}
|