private void check(String problem, String solution) { var sudoku = new Sudoku(new SudokuLegalMoveVerifier()); var problemParser = new SudokuProblemParser(); var solutionGrid = problemParser.parseProblem(solution); var problemGrid = problemParser.parseProblem(problem); var actualSolution = sudoku.solve(problemGrid); var prettyPrinter = new SudokuPrettyPrinter(); Assert.That(prettyPrinter.prettyPrint(actualSolution) , Is.EqualTo(prettyPrinter.prettyPrint(solutionGrid) )); }
private void check(String problem, String solution) { var sudoku = new Sudoku(new SudokuLegalMoveVerifier()); var problemParser = new SudokuProblemParser(); var solutionGrid = problemParser.parseProblem(solution); var problemGrid = problemParser.parseProblem(problem); var actualSolution = sudoku.solve(problemGrid); var prettyPrinter = new SudokuPrettyPrinter(); Assert.That(prettyPrinter.prettyPrint(actualSolution), Is.EqualTo(prettyPrinter.prettyPrint(solutionGrid))); }
public void impossible() { var sudoku = new Sudoku(new SudokuLegalMoveVerifier()); var problemParser = new SudokuProblemParser(); var problemGrid = problemParser.parseProblem(SudokuExamples.NOT_SOLVABLE_PROBLEM); var actualSolution = sudoku.solve(problemGrid); Assert.IsNull(actualSolution); }
public void impossible() { var sudoku = new Sudoku(new SudokuLegalMoveVerifier()); var problemParser = new SudokuProblemParser(); var problemGrid = problemParser.parseProblem(SudokuExamples.NOT_SOLVABLE_PROBLEM); var actualSolution = sudoku.solve(problemGrid); Assert.IsNull(actualSolution); }