public void GetShip_From_ShipFactory_Of_Type_CounterTorpedo_Should_Return_new_CounterTorpedo() { ShipFactory factory = new CounterTorpedoFactory(); CounterTorpedo newShip = new CounterTorpedo(); var res = factory.GetShip(); Assert.True(res.Name == newShip.Name && res.Size == newShip.Size && res.ShipType == newShip.ShipType); }
public void LostGame_With_Intact_Ship_Should_Return_False() { Player player = new Player(); var ship = new CounterTorpedo(); player.Ships.Add(ship); var res = player.LostGame; Assert.False(res); }
public void PlaceShip_CounterTorpedo_From_Unoccuped_A1_Coordinates_To_Unoccuped_A3_Coordinates_Should_Return_True() { Player player = new Player(); BoardCoordinates A1Coordinates = new BoardCoordinates(1, 1); BoardCoordinates A3Coordinates = new BoardCoordinates(1, 3); var ship = new CounterTorpedo(); var res = player.PlaceShip(ship, A1Coordinates, A3Coordinates); Assert.True(res); }
public void LostGame_With_Destroyed_Ship_Should_Return_True() { Player player = new Player(); var ship = new CounterTorpedo() { Damages = 3 }; player.Ships.Add(ship); var res = player.LostGame; Assert.True(res); }
public void PlaceShip_CounterTorpedo_From_Unoccuped_A1_Coordinates_To_Occuped_A3_Coordinates_Should_Return_True() { Player player = new Player(); BoardCoordinates A1Coordinates = new BoardCoordinates(1, 1); BoardCoordinates A3Coordinates = new BoardCoordinates(1, 3); var A3Cell = player.PersonnalBoardGame.Cells.First(cell => cell.BoardCoordinates.Coordinates == A3Coordinates.Coordinates); A3Cell.CellOccupant = ShipType.AICRAFT_CARRIER; var ship = new CounterTorpedo(); var res = player.PlaceShip(ship, A1Coordinates, A3Coordinates); Assert.False(res); }