public void Should_Create_Given_Number_Of_Ships()
        {
            var numberOfBattleShips = 2;
            var numberOfDestroyers  = 2;
            var totalShips          = numberOfBattleShips + numberOfDestroyers;

            var ships = new Dictionary <ShipType, int>
            {
                { ShipType.Battleship, numberOfBattleShips },
                { ShipType.Destroyer, numberOfDestroyers }
            };

            var gameBoard = _boardFactory.InitialiseBoard(ships);

            Assert.True(gameBoard.Ships.Count == totalShips);
        }
Exemple #2
0
 public BoardManager(IBoardFactory boardFactory, IConstants constants)
 {
     _boardFactory = boardFactory;
     _constants    = constants;
     ShipTypes     = new Dictionary <ShipType, int>
     {
         { ShipType.Battleship, _constants.NumberOfBattleships },
         { ShipType.Destroyer, _constants.NumberOfDestroyers }
     };
     GameBoard = _boardFactory.InitialiseBoard(ShipTypes);
 }