Ejemplo n.º 1
0
        public void SetupGame()
        {
            var gameBoardBuilder = new GameBoardBuilder(GridSize)
                                   .WithShips(1, ShipType.Battleship)
                                   .WithShips(2, ShipType.Destroyer);

            PlayerBoard = gameBoardBuilder.Build();
            AIBoard     = gameBoardBuilder.Build();

            _aiPlayer = new AIPlayer(AIBoard);
        }
Ejemplo n.º 2
0
        public void GivenSizeCreatesGameBoard()
        {
            var builder = new GameBoardBuilder();

            var board = builder.Build(new Size(2, 2));

            board.Squares.Should().ContainKeys(
                new Point(1, 1),
                new Point(1, 2),
                new Point(2, 1),
                new Point(2, 2)
                );
        }