예제 #1
0
        protected override void Arrange()
        {
            var sudoku = SudokuMother.CreateEmptySudoku();

            _sqr1 = sudoku.Sqr(1);

            sudoku.Row(1).SetValueOfCell(4).To(Solver.CellValue.Four);
            sudoku.Row(2).SetValueOfCell(7).To(Solver.CellValue.Four);

            Assert.That(sudoku.Row(1).Contains(Solver.CellValue.Four), Is.EqualTo(true));
            Assert.That(sudoku.Row(2).Contains(Solver.CellValue.Four), Is.EqualTo(true));
            Assert.That(sudoku.Row(3).Contains(Solver.CellValue.Four), Is.EqualTo(false));

            Assert.That(_sqr1.Cell(7).CanBe(Solver.CellValue.Four), Is.EqualTo(Tristate.DontKnow));
            Assert.That(_sqr1.Cell(8).CanBe(Solver.CellValue.Four), Is.EqualTo(Tristate.DontKnow));
            Assert.That(_sqr1.Cell(9).CanBe(Solver.CellValue.Four), Is.EqualTo(Tristate.DontKnow));
        }
        protected override void Arrange()
        {
            var sudoku = SudokuMother.CreateEmptySudoku();

            _sqr1 = sudoku.Sqr(1);

            sudoku.SetValueOfCell(4, 1).To(Solver.CellValue.Five);
            sudoku.SetValueOfCell(7, 2).To(Solver.CellValue.Five);

            Assert.That(sudoku.Col(1).Contains(Solver.CellValue.Five), Is.EqualTo(true));
            Assert.That(sudoku.Col(2).Contains(Solver.CellValue.Five), Is.EqualTo(true));
            Assert.That(sudoku.Col(3).Contains(Solver.CellValue.Five), Is.EqualTo(false));

            Assert.That(_sqr1.Cells[2].CanBe(Solver.CellValue.Five), Is.EqualTo(Tristate.DontKnow));
            Assert.That(_sqr1.Cells[5].CanBe(Solver.CellValue.Five), Is.EqualTo(Tristate.DontKnow));
            Assert.That(_sqr1.Cells[8].CanBe(Solver.CellValue.Five), Is.EqualTo(Tristate.DontKnow));
        }