public void ReturnZeroWhenThereIsNoBombSurrounding() { var surroundingChecker = new SurroundingChecker(); var field = new Field() { NoOfRows = 4, NoOfColumns = 5, Value = "*...." + "....." + ".*..." + "....." }; var square = new Square { XCoordinate = 3, YCoordinate = 4, IsBomb = false, }; var actual = surroundingChecker.CheckBomb(square, field); var expected = "1"; Assert.AreEqual(expected, actual); }
public void ReturnNoOfBombsSurroundingSquare() { var surroundingChecker = new SurroundingChecker(); var field = new Field() { NoOfRows = 4, NoOfColumns = 4, Value = "*..." + "...." + ".*.." + "...." }; var square = new Square { XCoordinate = 2, YCoordinate = 2, IsBomb = false, }; var actual = surroundingChecker.CheckBomb(square, field); var expected = "2"; Assert.AreEqual(expected, actual); }
public void ReturnBombSymbolIfSquareContainsBomb() { var surroundingChecker = new SurroundingChecker(); var field = new Field() { NoOfRows = 4, NoOfColumns = 4, Value = "*..." + "...." + "...." + ".*.." }; var square = new Square { XCoordinate = 4, YCoordinate = 2, IsBomb = true, }; var actual = surroundingChecker.CheckBomb(square, field); var expected = "*"; Assert.AreEqual(expected, actual); }