Exemplo n.º 1
0
 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) ));
 }
Exemplo n.º 2
0
        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)));
        }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 4
0
        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);
        }