示例#1
0
        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());
        }
示例#2
0
        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());
        }
示例#3
0
        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());
        }
示例#4
0
        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());
        }