Added PGNDatabaseTest and test file
This commit is contained in:
36
test/dev/kske/chess/pgn/PGNDatabaseTest.java
Normal file
36
test/dev/kske/chess/pgn/PGNDatabaseTest.java
Normal file
@@ -0,0 +1,36 @@
|
||||
package dev.kske.chess.pgn;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.fail;
|
||||
|
||||
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
|
||||
* @throws FileNotFoundException
|
||||
*/
|
||||
@Test
|
||||
void testLoad() {
|
||||
PGNDatabase db = new PGNDatabase();
|
||||
try {
|
||||
db.load(new File(getClass().getClassLoader().getResource("test.pgn").getFile()));
|
||||
} catch (FileNotFoundException | ChessException e) {
|
||||
e.printStackTrace();
|
||||
fail(e);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user