@Test public void testFillSudokuGame() throws Exception { Random random = new Random(); moveThroughGame(game, (i, j) -> Int.fromInteger(random.nextInt(SIZE * SIZE) + 1)); assertThat(game.isFill(), is(true)); }
@Test public void testFindPossibleRowToResolve() throws Exception { moveThroughGame(game, (i, j) -> Int.fromInteger((i * SIZE + i / SIZE + j) % (SIZE * SIZE) + 1)); game.set(8, 1, Int.ZERO); game.set(9, 1, Int.ZERO); assertThat(game.possibleRowsToResolve(), containsInAnyOrder(8, 9)); }
@Test public void testResolveCellBySquare() throws Exception { moveThroughGame(game, (i, j) -> Int.fromInteger((i * SIZE + i / SIZE + j) % (SIZE * SIZE) + 1)); game.set(9, 1, Int.ZERO); game.resolveBySquare(3, 1); assertThat(game.get(9, 1), is(Int.NINE)); }