165 lines
3.8 KiB
Java
165 lines
3.8 KiB
Java
package dev.kske.chess.board;
|
|
|
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
|
import static org.junit.jupiter.api.Assertions.assertNotEquals;
|
|
import static org.junit.jupiter.api.Assertions.assertNull;
|
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
|
import static org.junit.jupiter.api.Assertions.fail;
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
import dev.kske.chess.board.Piece.Color;
|
|
|
|
/**
|
|
* Project: <strong>Chess</strong><br>
|
|
* File: <strong>LogTest.java</strong><br>
|
|
* Created: <strong>13 Sep 2019</strong><br>
|
|
* Author: <strong>Kai S. K. Engelbart</strong>
|
|
*/
|
|
class LogTest {
|
|
|
|
Log log = new Log();
|
|
|
|
/**
|
|
* Test method for {@link dev.kske.chess.board.Log#Log()}.
|
|
*/
|
|
@Test
|
|
void testLog() {
|
|
assertTrue(log.isEmpty());
|
|
assertNull(log.getLast());
|
|
assertNull(log.getRoot());
|
|
assertEquals(log.getActiveColor(), Color.WHITE);
|
|
assertNull(log.getEnPassant());
|
|
assertEquals(log.getFullmoveCounter(), 1);
|
|
assertEquals(log.getHalfmoveClock(), 0);
|
|
}
|
|
|
|
/**
|
|
* Test method for {@link dev.kske.chess.board.Log#clone()}.
|
|
*/
|
|
@Test
|
|
void testClone() {
|
|
Log other = new Log(log, false);
|
|
log.setActiveColor(Color.WHITE);
|
|
other.setActiveColor(Color.BLACK);
|
|
assertNotEquals(log.getActiveColor(), other.getActiveColor());
|
|
log.add(Move.fromSAN("a2a4"), null, true);
|
|
log.add(Move.fromSAN("a4a5"), null, true);
|
|
other.add(Move.fromSAN("a2a4"), null, true);
|
|
other.add(Move.fromSAN("a4a5"), null, true);
|
|
assertNotEquals(log.getRoot(), other.getRoot());
|
|
assertNotEquals(log.getRoot().getVariations(), other.getRoot().getVariations());
|
|
}
|
|
|
|
/**
|
|
* Test method for {@link dev.kske.chess.board.Log#add(dev.kske.chess.board.Move, dev.kske.chess.board.Piece, boolean)}.
|
|
*/
|
|
@Test
|
|
void testAdd() {
|
|
fail("Not yet implemented");
|
|
}
|
|
|
|
/**
|
|
* Test method for {@link dev.kske.chess.board.Log#removeLast()}.
|
|
*/
|
|
@Test
|
|
void testRemoveLast() {
|
|
fail("Not yet implemented");
|
|
}
|
|
|
|
/**
|
|
* Test method for {@link dev.kske.chess.board.Log#isEmpty()}.
|
|
*/
|
|
@Test
|
|
void testIsEmpty() {
|
|
fail("Not yet implemented");
|
|
}
|
|
|
|
/**
|
|
* Test method for {@link dev.kske.chess.board.Log#reset()}.
|
|
*/
|
|
@Test
|
|
void testReset() {
|
|
fail("Not yet implemented");
|
|
}
|
|
|
|
/**
|
|
* Test method for {@link dev.kske.chess.board.Log#getRoot()}.
|
|
*/
|
|
@Test
|
|
void testGetRoot() {
|
|
fail("Not yet implemented");
|
|
}
|
|
|
|
/**
|
|
* Test method for {@link dev.kske.chess.board.Log#getLast()}.
|
|
*/
|
|
@Test
|
|
void testGetLast() {
|
|
fail("Not yet implemented");
|
|
}
|
|
|
|
/**
|
|
* Test method for {@link dev.kske.chess.board.Log#getEnPassant()}.
|
|
*/
|
|
@Test
|
|
void testGetEnPassant() {
|
|
fail("Not yet implemented");
|
|
}
|
|
|
|
/**
|
|
* Test method for {@link dev.kske.chess.board.Log#setEnPassant(dev.kske.chess.board.Position)}.
|
|
*/
|
|
@Test
|
|
void testSetEnPassant() {
|
|
fail("Not yet implemented");
|
|
}
|
|
|
|
/**
|
|
* Test method for {@link dev.kske.chess.board.Log#getActiveColor()}.
|
|
*/
|
|
@Test
|
|
void testGetActiveColor() {
|
|
fail("Not yet implemented");
|
|
}
|
|
|
|
/**
|
|
* Test method for {@link dev.kske.chess.board.Log#setActiveColor(dev.kske.chess.board.Piece.Color)}.
|
|
*/
|
|
@Test
|
|
void testSetActiveColor() {
|
|
fail("Not yet implemented");
|
|
}
|
|
|
|
/**
|
|
* Test method for {@link dev.kske.chess.board.Log#getFullmoveCounter()}.
|
|
*/
|
|
@Test
|
|
void testGetFullmoveCounter() {
|
|
fail("Not yet implemented");
|
|
}
|
|
|
|
/**
|
|
* Test method for {@link dev.kske.chess.board.Log#setFullmoveCounter(int)}.
|
|
*/
|
|
@Test
|
|
void testSetFullmoveCounter() {
|
|
fail("Not yet implemented");
|
|
}
|
|
|
|
/**
|
|
* Test method for {@link dev.kske.chess.board.Log#getHalfmoveClock()}.
|
|
*/
|
|
@Test
|
|
void testGetHalfmoveClock() {
|
|
fail("Not yet implemented");
|
|
}
|
|
|
|
/**
|
|
* Test method for {@link dev.kske.chess.board.Log#setHalfmoveClock(int)}.
|
|
*/
|
|
@Test
|
|
void testSetHalfmoveClock() {
|
|
fail("Not yet implemented");
|
|
}
|
|
} |