Example #1
0
        public async Task ShouldAddShip_Return_Ship_When_Created_Successfully()
        {
            var battle = await _battleService.InitiateBattle(10, 6, 3);

            var ship = await _battleService.AddShip(battle.Id.ToString(), new Coordinate(0, 0),
                                                    ShipDirection.Horizontal);

            Assert.NotNull(ship);
            Assert.Contains(ship.Cells, (c) => c.Status == GridCellStatus.Battleship);
            Assert.Equal(ShipDirection.Horizontal, ship.Direction);
        }
        public void ShouldAddShip_Return_Ship_When_Created_Successfully()
        {
            //Arrange
            var battle = _battleService.InitiateBattle(10, 6, 3);

            //Act
            var ship = _battleService.AddShip(battle.Id.ToString(), new Coordinate(0, 0),
                                              ShipDirection.Horizontal, ShipType.CarrierShip);

            //Arrange
            Assert.NotNull(ship);
            Assert.Contains(ship.Cells, (c) => c.Status == Occupation.Ship);
        }