34 lines
917 B
Java
34 lines
917 B
Java
package dev.kske.chess.pgn;
|
|
|
|
import java.io.File;
|
|
import java.io.FileNotFoundException;
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
import dev.kske.chess.exception.ChessException;
|
|
|
|
/**
|
|
* Project: <strong>Chess</strong><br>
|
|
* File: <strong>PGNDatabaseTest.java</strong><br>
|
|
* Created: <strong>4 Oct 2019</strong><br>
|
|
* Author: <strong>Kai S. K. Engelbart</strong>
|
|
*/
|
|
class PGNDatabaseTest {
|
|
|
|
/**
|
|
* Test method for
|
|
* {@link dev.kske.chess.pgn.PGNDatabase#load(java.io.File)}.
|
|
*
|
|
* @throws ChessException if an error occurs while parsing the file
|
|
* @throws FileNotFoundException if the test file {@code test.pgn} is not
|
|
* present
|
|
*/
|
|
@Test
|
|
void testLoad() throws FileNotFoundException, ChessException {
|
|
PGNDatabase db = new PGNDatabase();
|
|
db.load(
|
|
new File(getClass().getClassLoader().getResource("test.pgn").getFile())
|
|
);
|
|
}
|
|
}
|