public void HaveEmptyNeighbourShouldReturnTrueByPresenceOfEmptyNeighbour() { int[,] firstMatrix = { { 1, 2, 3 }, { 4, 5, 0 }, { 7, 8, 9 } }; Assert.AreEqual(true, FillMatrix.HaveEmptyNeighbour(firstMatrix, 0, 2)); int[,] secondMatrix = { { 1, 2, 3 }, { 4, 5, 6 }, { 0, 8, 9 } }; Assert.AreEqual(true, FillMatrix.HaveEmptyNeighbour(secondMatrix, 1, 1)); int[,] thirdMatrix = { { 1, 0, 3 }, { 4, 5, 6 }, { 7, 8, 9 } }; Assert.AreEqual(true, FillMatrix.HaveEmptyNeighbour(thirdMatrix, 1, 0)); }
public void HaveEmptyNeighbourShouldReturnFalseIfOnlyEmptyCellIsNotNeighbourOfCurrentCell() { int[,] firstMatrix = { { 1, 2, 3 }, { 4, 5, 0 }, { 7, 8, 9 } }; Assert.AreEqual(false, FillMatrix.HaveEmptyNeighbour(firstMatrix, 0, 0)); int[,] secondMatrix = { { 1, 2, 3 }, { 4, 5, 6 }, { 0, 8, 9 } }; Assert.AreEqual(false, FillMatrix.HaveEmptyNeighbour(secondMatrix, 1, 2)); int[,] thirdMatrix = { { 1, 0, 3 }, { 4, 5, 6 }, { 7, 8, 9 } }; Assert.AreEqual(false, FillMatrix.HaveEmptyNeighbour(thirdMatrix, 2, 1)); }