Added PGNDatabaseTest and test file

This commit is contained in:
2019-10-21 21:45:38 +02:00
parent 1f2cedd455
commit acb0e63c82
2 changed files with 54 additions and 0 deletions

View 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);
}
}
}