Пример #1
0
        public void UpdateTheStatusOfACellToRecordAMineAsFalse()
        {
            //Arrange
            var gridSize         = 2;
            var newGame          = GridFactory.NewGameGrid(gridSize);
            var updateMineStatus = new MineUpdater();
            var mineStub         = new StubForMineLocationZeroZero();

            //Act
            updateMineStatus.UpdateCellWithMineStatus(mineStub.MineLocations(newGame.Size), newGame);

            //Assert
            Assert.False(newGame.GeneratedGameCell[1, 1].IsMine);
        }
Пример #2
0
        public void ReturnTrueIfPlayerHasSelectedAMine()
        {
            //Arrange
            var size             = 2;
            var newValidation    = Factory.NewUserInputValidation();
            var gameGrid         = GridFactory.NewGameGrid(size);
            var userInput        = new PlayerMove(0, 0);
            var updateMineStatus = new MineUpdater();
            var mineStub         = new StubForMineLocationZeroZero();

            //Act
            updateMineStatus.UpdateCellWithMineStatus(mineStub.MineLocations(gameGrid.Size), gameGrid);

            //Assert
            Assert.True(newValidation.IsGameOver(gameGrid, userInput));
        }