Moved tests in test source folder, replaced GameModeDialog by MenuBar
This commit is contained in:
43
test/dev/kske/chess/test/BoardTest.java
Normal file
43
test/dev/kske/chess/test/BoardTest.java
Normal 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]);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user