Suitable exceptions for setBoard with corresponding tests

This commit is contained in:
Imbus 2023-12-10 15:04:04 +01:00
parent f449d2343e
commit 175545d3d5
2 changed files with 14 additions and 3 deletions

View file

@ -106,4 +106,11 @@ class SolverTest {
solver.set(7, 1, 8);
assertFalse(solver.solve());
}
@Test
void setBoardInvalidInputThrowsTest() {
Solver solver = new Solver();
assertThrows(NullPointerException.class, () -> solver.setBoard(null));
assertThrows(IllegalArgumentException.class, () -> solver.setBoard(new int[8][8]));
}
}