public void GetShip_From_ShipFactory_Of_Type_TorpedoBoat_Should_Return_Ship_OfType_TorpedoBoat() { ShipFactory factory = new TorpedoBoatFactory(); var res = factory.GetShip(); Assert.IsType <TorpedoBoat>(res); }
public void GetShip_From_ShipFactory_Of_Type_TorpedoBoat_Should_Return_new_TorpedoBoat() { ShipFactory factory = new TorpedoBoatFactory(); TorpedoBoat newShip = new TorpedoBoat(); var res = factory.GetShip(); Assert.True(res.Name == newShip.Name && res.Size == newShip.Size && res.ShipType == newShip.ShipType); }
public List <Ship> InitPlayerShips() { ShipFactory cruiserFactory = new CruiserFactory(); ShipFactory aircraftCarrierFactory = new AircraftCarrierFactory(); ShipFactory torpedoBoatFactory = new TorpedoBoatFactory(); ShipFactory counterTorpedoFactory = new CounterTorpedoFactory(); List <Ship> ships = new List <Ship>() { cruiserFactory.GetShip(), counterTorpedoFactory.GetShip(), counterTorpedoFactory.GetShip(), aircraftCarrierFactory.GetShip(), torpedoBoatFactory.GetShip() }; return(ships); }