Extending testcases
This commit is contained in:
parent
f9fa515651
commit
af77468edc
1 changed files with 32 additions and 1 deletions
|
@ -86,7 +86,7 @@ class SolverTest {
|
|||
@Test
|
||||
void unsolvableTest() {
|
||||
Solver solver = new Solver();
|
||||
|
||||
|
||||
// Simple example
|
||||
solver.clear();
|
||||
solver.set(0, 0, 1);
|
||||
|
@ -107,6 +107,37 @@ class SolverTest {
|
|||
assertFalse(solver.solve());
|
||||
}
|
||||
|
||||
@Test
|
||||
void unsolvableTestCase3() {
|
||||
Solver solver = new Solver();
|
||||
|
||||
// More complex example
|
||||
solver.clear();
|
||||
solver.set(0, 0, 1);
|
||||
solver.set(0, 1, 2);
|
||||
solver.set(0, 2, 3);
|
||||
solver.set(1, 0, 4);
|
||||
solver.set(1, 1, 5);
|
||||
solver.set(1, 2, 6);
|
||||
solver.set(2, 3, 7);
|
||||
assertFalse(solver.isSolvable());
|
||||
}
|
||||
|
||||
@Test
|
||||
void solvableTestCase3() {
|
||||
Solver solver = new Solver();
|
||||
|
||||
// More complex example
|
||||
solver.clear();
|
||||
solver.set(0, 0, 1);
|
||||
solver.set(0, 1, 2);
|
||||
solver.set(0, 2, 3);
|
||||
solver.set(1, 0, 4);
|
||||
solver.set(1, 1, 5);
|
||||
solver.set(1, 2, 6);
|
||||
assertTrue(solver.isSolvable());
|
||||
}
|
||||
|
||||
@Test
|
||||
void setBoardInvalidInputThrowsTest() {
|
||||
Solver solver = new Solver();
|
||||
|
|
Loading…
Reference in a new issue