Beispiel #1
0
        public void LastOneCantSolve()
        {
            solver = new OneLeftSolver();
            bool solvedIt = solver.SolveCell(puzzle, 3, 0);

            Assert.IsFalse(solvedIt);
        }
Beispiel #2
0
        public void LastOneRow()
        {
            solver = new OneLeftSolver();
            bool solvedIt = solver.SolveCell(puzzle, 0, 2);

            Assert.IsTrue(solvedIt);
            Assert.AreEqual(puzzle.Cells[0, 2].Value, '3');
        }
Beispiel #3
0
        public void LastOneColumn()
        {
            solver = new OneLeftSolver();
            bool solvedIt = solver.SolveCell(puzzle, 2, 3);

            Assert.IsTrue(solvedIt);
            Assert.AreEqual(puzzle.Cells[2, 3].Value, '4');
        }
Beispiel #4
0
        public void LastOneBox()
        {
            solver = new OneLeftSolver();
            bool solvedIt = solver.SolveCell(puzzle, 1, 0);

            Assert.IsTrue(solvedIt);
            Assert.AreEqual(puzzle.Cells[1, 0].Value, '1');
        }
Beispiel #5
0
        public void DepthFirstSolve()
        {
            solver = new DepthFirstSolver();
            bool solvedIt = solver.SolveCell(puzzle, 0, 0);

            Assert.IsTrue(solvedIt);
            Assert.IsTrue(solver.IsSolved(puzzle));
        }
Beispiel #6
0
        public void DepthFirstCantSolve()
        {
            solver = new DepthFirstSolver();
            puzzle.Cells[0, 2].Value = '4';
            bool solvedIt = solver.SolveCell(puzzle, 0, 0);

            Assert.IsFalse(solvedIt);
        }