Ejemplo n.º 1
0
        static void ThingsACoupeCanDo()
        {
            Coupe coupe = new Coupe();

            Console.WriteLine("-----does a coupe make noise?-----");
            bool output1 = coupe.MakesNoise;

            Console.WriteLine(output1);
            Console.WriteLine("-----does a coupe start?-----");
            bool output2 = coupe.Starts;

            Console.WriteLine(output2);
            Console.WriteLine("----------Does a coupe honk?-------------");
            Console.WriteLine(coupe.Honk());
            Console.WriteLine("-----Does a coupe turn on?-----");
            Console.WriteLine(coupe.TurnOn());
            Console.WriteLine("-----Does the coupe drive?-----");
            Console.WriteLine(coupe.DriveForward());
            Console.WriteLine("------Does the coupe go in reverse?------");
            Console.WriteLine(coupe.Reverse());
            Console.WriteLine("------Does a coupe turn off?------");
            Console.WriteLine(coupe.TurnOff());
            Console.WriteLine("price:");
            Console.WriteLine(coupe.Price);
        }
Ejemplo n.º 2
0
 public VehicleManager()
 {
     saloon = new Saloon(new StandardEngine(1300));
     coupe  = new Coupe(new StandardEngine(1300));
     sport  = new Sport(new StandardEngine(1300));
     boxvan = new BoxVan(new StandardEngine(1300));
     pickup = new PickUp(new StandardEngine(1300));
 }
 public virtual IVehicle CreateCoupe()
 {
     if (coupe == null)
     {
         coupe = new Coupe(new StandardEngine(1300));
     }
     return (IVehicle)coupe.Clone();
 }
        public void CoupeCanTurnOn()
        {
            //arrange
            Coupe coupe = new Coupe();
            //act
            string var = coupe.TurnOn();

            //assert
            Assert.Equal("The Coupe has turned on", var);
        }
        public void CoupeIsReaL()
        {
            //arrange
            Coupe coupe = new Coupe();
            //act
            bool output = coupe.IsReal;

            //assert
            Assert.False(output);
        }
        public void CoupeMakesnoise()
        {
            //arrange
            Coupe coupe = new Coupe();
            //act
            bool output1 = coupe.MakesNoise;

            //assert
            Assert.True(output1);
        }
        public void CoupeCanHonk()
        {
            //arrange
            Coupe coupe = new Coupe();
            //act
            string output = coupe.Honk();


            //assert
            Assert.Equal("BEEP BEEP im a coupe!", output);
        }
        public void CoupeCanDrive()
        {
            //arrange
            Coupe coupe = new Coupe();
            //act
            string output = coupe.DriveForward();


            //assert
            Assert.Equal("The car drives forward", output);
        }
        public void CoupePrice()
        {
            //arrange
            Coupe coupe = new Coupe();
            //act

            int output1 = coupe.Price;

            //assert
            Assert.Equal(3000, output1);
        }
        public void TheCoupeCanreverse()
        {
            //arrange
            Coupe coupe = new Coupe();

            //act

            string output = coupe.Reverse();

            //assert
            Assert.Equal("The car Reverses", output);
        }
        public static CoupeModel ToModel(this Coupe dto)
        {
            CoupeModel result = new CoupeModel();

            result.Id          = dto.Id;
            result.Nom         = dto.Nom;
            result.CodePostal  = dto.CodePostal;
            result.Complement  = dto.Complement;
            result.DateDebut   = dto.DateDebut;
            result.DateFin     = dto.DateFin;
            result.Description = dto.Description;
            result.Numero      = (int)dto.Numero;
            result.Ville       = dto.Ville;
            result.Voie        = dto.Voie;
            return(result);
        }
Ejemplo n.º 12
0
        public void TestIsDrivingClass()
        {
            Coupe car = new Coupe();

            //Is the car driving
            Assert.AreEqual(true, car.IsDriving());

            //Start the car
            car.SetDriving(true);
            //Is the car Driving
            Assert.IsTrue(car.IsDriving());

            //stop the car
            car.SetDriving(false);
            //has the car stopped driving
            Assert.IsFalse(car.IsDriving());
        }
Ejemplo n.º 13
0
        protected internal override IVehicle SelectVehicle
            (DrivingStyle style)
        {
            IVehicle selectedVehicle;

            if (style == DrivingStyle.Economical)
            {
                selectedVehicle = new Saloon(new StandardEngine(1300));
            }
            else if (style == DrivingStyle.Midrange)
            {
                selectedVehicle = new Coupe(new StandardEngine(1600));
            }
            else
            {
                selectedVehicle = new Sport(new TurboEngine(2000));
            }

            return(selectedVehicle);
        }
Ejemplo n.º 14
0
        static void Main(string[] args)
        {
            try
            {
                Coupe coupe = new Coupe
                {
                    Brakes     = "disc",
                    EngineType = EngineType.V8,
                    NoOfTires  = 4
                };


                Automobile auto = new Automobile
                {
                    Brakes     = "disc",
                    EngineType = EngineType.V8,
                    NoOfTires  = 4
                };

                Coupe coupeTwin = coupe;
                coupeTwin.EngineType = EngineType.V6;

                Console.WriteLine($"coupe has enginetype {coupe.EngineType.ToString()}");
                Console.WriteLine($"coupeTwin has enginetype {coupeTwin.EngineType.ToString()}");

                Automobile autoTwin = auto;
                autoTwin.EngineType = EngineType.V6;

                Console.WriteLine($"auto has enginetype {auto.EngineType.ToString()}");

                Console.WriteLine($"autoTwin has enginetype {autoTwin.EngineType.ToString()}");
                Console.ReadLine();
            }
            catch (Exception e)
            { throw e; }
        }
 public SportCoupeBuilder()
 {
     _car = new Coupe();
 }
 public CoupeBuilder()
 {
     _car = new Coupe();
 }