Esempio n. 1
0
        public void GetShip_From_ShipFactory_Of_Type_CounterTorpedo_Should_Return_Ship_OfType_CounterTorpedo()
        {
            ShipFactory factory = new CounterTorpedoFactory();

            var res = factory.GetShip();

            Assert.IsType <CounterTorpedo>(res);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
        }