Moved tests in test source folder, replaced GameModeDialog by MenuBar

This commit is contained in:
2019-07-16 11:58:51 +02:00
parent 7a986ab9c4
commit 8eda941284
6 changed files with 95 additions and 101 deletions

View File

@ -0,0 +1,43 @@
package dev.kske.chess.test;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotSame;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import dev.kske.chess.board.Board;
import dev.kske.chess.board.Piece.Color;
import dev.kske.chess.board.Queen;
/**
* 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 {
Board board;
/**
* @throws java.lang.Exception
*/
@BeforeEach
void setUp() throws Exception {
board = new Board();
}
/**
* Test method for {@link dev.kske.chess.board.Board#clone()}.
*/
@Test
void testClone() {
Board clone = (Board) board.clone();
assertNotSame(clone, board);
assertNotSame(clone.getBoardArr(), board.getBoardArr());
clone.getBoardArr()[0][0] = new Queen(Color.BLACK, clone);
assertNotEquals(clone.getBoardArr()[0][0], board.getBoardArr()[0][0]);
}
}