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