Ejemplo n.º 1
0
        public void TestGetPossibilities()
        {
            RemainderStrat solverStrat = new RemainderStrat();
            FileIO         fileIO      = new FileIO();
            Puzzle         newPuzzle   = fileIO.ReadPuzzle(puzzleIncomplete);

            Assert.AreEqual(solverStrat.GetPossibilities(newPuzzle, 1, 0), '4');
        }
Ejemplo n.º 2
0
        public void TestRemainderSolve()
        {
            RemainderStrat remainderStrat   = new RemainderStrat();
            FileIO         fileIO           = new FileIO();
            Puzzle         incompletePuzzle = fileIO.ReadPuzzle(puzzleIncomplete);
            Puzzle         completePuzzle   = fileIO.ReadPuzzle(puzzleComplete);

            Assert.AreEqual(remainderStrat.Solve(incompletePuzzle).Plane, completePuzzle.Plane);
        }
Ejemplo n.º 3
0
        public void TestGetInBlock()
        {
            RemainderStrat solverStrat = new RemainderStrat();
            FileIO         fileIO      = new FileIO();
            Puzzle         newPuzzle   = fileIO.ReadPuzzle(puzzleIncomplete);
            string         inBlock     = "2-13";

            Assert.AreEqual(solverStrat.GetInCol(newPuzzle, 1, 1), inBlock);
        }
Ejemplo n.º 4
0
        public void TestGetInRow()
        {
            RemainderStrat solverStrat = new RemainderStrat();
            FileIO         fileIO      = new FileIO();
            Puzzle         newPuzzle   = fileIO.ReadPuzzle(puzzleIncomplete);
            string         inRow       = "2-31";

            Assert.AreEqual(solverStrat.GetInCol(newPuzzle, 1, 0), inRow);
        }
Ejemplo n.º 5
0
        public void TestCheckIfSolved()
        {
            RemainderStrat solverStrat = new RemainderStrat();
            FileIO         fileIO      = new FileIO();
            Puzzle         newPuzzle   = fileIO.ReadPuzzle(puzzleIncomplete);

            Assert.AreEqual(solverStrat.CheckIfSolved(newPuzzle), false);
            newPuzzle = fileIO.ReadPuzzle(puzzleComplete);
            Assert.AreEqual(solverStrat.CheckIfSolved(newPuzzle), true);
        }