public void CreatePositionFromEmptyString() { Position position = new Position(string.Empty); Assert.AreEqual(9, position.Size); Assert.AreEqual(3, position.Range); Assert.AreEqual(0, position.GetCellsWithNumbers().Count); var result = position.GetPossibleNumbersAt(0, 0); for (int k = 1; k <= 9; k++) Assert.IsTrue(result.Contains(k)); }
public void CreatePositionWithOneNumber() { Position position = new Position("9"); Assert.AreEqual(9, position.Size); Assert.AreEqual(3, position.Range); var cells = position.GetCellsWithNumbers(); Assert.AreEqual(1, cells.Count); Assert.AreEqual(9, cells[0].Number); Assert.AreEqual(0, cells[0].X); Assert.AreEqual(0, cells[0].Y); var result = position.GetPossibleNumbersAt(1, 0); for (int k = 1; k < 9; k++) Assert.IsTrue(result.Contains(k)); }
public void CreatePositionWithTwoNumbersAtFirstColumn() { Position position = new Position("8........9"); Assert.AreEqual(9, position.Size); Assert.AreEqual(3, position.Range); var cells = position.GetCellsWithNumbers(); Assert.AreEqual(2, cells.Count); Assert.AreEqual(8, cells[0].Number); Assert.AreEqual(0, cells[0].X); Assert.AreEqual(0, cells[0].Y); Assert.AreEqual(9, cells[1].Number); Assert.AreEqual(0, cells[1].X); Assert.AreEqual(1, cells[1].Y); }