public void AllNeighborsOfCellWithoutAnyBombInNeighborhoodWillBeShown() { var minesweeper = new Minesweeper(new bool[3, 3]); minesweeper.CellChoosen(1, 1); Assert.AreEqual(" 0 1 2\n0 \n1 \n2 \n", minesweeper.GetActualViewOfField()); }
public void CreatesViewRepresentaionOfField() { var minesweeper = new Minesweeper(new[, ] { { false, false, false }, { false, false, false }, { false, false, true } }); minesweeper.CellChoosen(0, 0); Assert.AreEqual(" 0 1 2\n0 \n1 1 1\n2 1 -\n", minesweeper.GetActualViewOfField()); }
public void AllCellsExceptTheBombsOnTheEdgesWillBeDisplayedOnMiddleBombChoosen() { var minesweeper = new Minesweeper(new[, ] { { true, true, true, true, true }, { true, false, false, false, true }, { true, false, false, false, true }, { true, false, false, false, true }, { true, true, true, true, true } }); minesweeper.CellChoosen(2, 2); Assert.AreEqual(" 0 1 2 3 4\n0- - - - -\n1- 5 3 5 -\n2- 3 3 -\n3- 5 3 5 -\n4- - - - -\n", minesweeper.GetActualViewOfField()); }
public void ChoosenCellWithThreeBombsInNeighborhoodWillBeShown() { var minesweeper = new Minesweeper(new[, ] { { false, false, false }, { false, false, false }, { true, true, true } }); minesweeper.CellChoosen(1, 1); Assert.AreEqual(" 0 1 2\n0- - -\n1- 3 -\n2- - -\n", minesweeper.GetActualViewOfField()); }