public void WhenACoordinateHasBeenExploredThenIsExploredIsTrue() { var minefield = Minefield.Empty(2, 3); var coordinate = new Coordinates(0, 1); var exploredMinefield = minefield.Explore(coordinate); Assert.AreEqual(true, exploredMinefield.IsExplored(coordinate.RowIndex, coordinate.ColumnIndex)); }
public void InitiallyAllMineLocationsUnexplored() { var minefield = Minefield.Empty(2, 3); Assert.AreEqual(false, minefield.IsExplored(0, 0)); Assert.AreEqual(false, minefield.IsExplored(2, 1)); Assert.AreEqual(false, minefield.IsExplored(1, 1)); }
public void ExploreDifferentRowsOnce() { var minefield = Minefield.Empty(2, 3); Minefield exploredMinefield = minefield.Explore(new Coordinates(0, 1)); Minefield furtherExploredMinefield = exploredMinefield.Explore(new Coordinates(1, 0)); Assert.AreEqual(true, furtherExploredMinefield.IsExplored(1, 0)); Assert.AreEqual(true, furtherExploredMinefield.IsExplored(0, 1)); }
public void ExploringARowTwiceWorks() { var minefield = Minefield.Empty(2, 3); Minefield exploredMinefield = minefield.Explore(new Coordinates(0, 1)); Minefield furtherExploredMinefield = exploredMinefield.Explore(new Coordinates(0, 0)); Assert.AreEqual(true, furtherExploredMinefield.IsExplored(0, 0)); Assert.AreEqual(true, furtherExploredMinefield.IsExplored(0, 1)); }
public void UnexploredSquaresAreShownAsHashes() { // Given var minefield = Minefield.Empty(3, 2); // When var result = MinefieldRenderer.RenderMinefield(minefield); // Then var expected = " 123\nA###\nB###\n"; Assert.AreEqual(expected, result); }
public void ExploredSquaresAreShownAsSpaces() { // Given var minefield = Minefield.Empty(3, 2).Explore(new Coordinates(0, 1)); // When var result = MinefieldRenderer.RenderMinefield(minefield); // Then var expected = " 123\nA# #\nB###\n"; Assert.AreEqual(expected, result); }