static void Main(string[] args)
    {
        // create a new instance of Car
        //Car myCar = new Car("Adam Freeman", "Black", 30);
        //myCar.PrintCarDetails();

        // create an instance of VolvoCar
        //VolvoCar myVolvo = new VolvoCar("Adam Freeman", "Black", 30, "High Performance");
        //myVolvo.PrintCarDetails();

        //int fuelRequired = myVolvo.CalculateFuelForTrip(1000);
        //Console.WriteLine("Fuel Required: {0} gallons", fuelRequired);

        VolvoC30 myC30 = new VolvoC30("Adam Freeman", "Black", 30, "High Performance");

        myC30.PrintCarDetails();
        FordFiesta myFiesta = new FordFiesta("Joe Smith", "Yellow", 35, "18 inch sports");

        myFiesta.PrintCarDetails();



        // wait for input before exiting
        Console.WriteLine("Press enter to finish");
        Console.ReadLine();
    }
Exemplo n.º 2
0
        public void FordFiestaConAire()
        {
            Vendible auto = new FordFiesta();

            auto = new AireAcondicionado(auto);
            auto = new ReproductorMp3(auto);

            Assert.AreEqual(auto.GetPrecio(), 1800);
        }
Exemplo n.º 3
0
        public static void Main()
        {
            // Build a collection of all vehicles that fly
            var airplane   = new Boeing747(200, 250, VehicleColor.Green);
            var helecopter = new Helecoptor(150, 4, VehicleColor.Black);

            List <Aircraft> aircrafts = new List <Aircraft>();

            aircrafts.Add(airplane);
            aircrafts.Add(helecopter);


            // With a single `foreach`, have each vehicle Fly()
            foreach (var aircraft in aircrafts)
            {
                aircraft.Fly(1000);
            }

            // Build a collection of all vehicles that operate on roads
            var ford  = new FordFiesta(12, 5, VehicleColor.Red);
            var jetta = new VWJetta(20, 5, VehicleColor.White);

            List <Car> cars = new List <Car>();

            cars.Add(ford);
            cars.Add(jetta);

            // With a single `foreach`, have each road vehicle Drive()
            foreach (var car in cars)
            {
                car.Drive(50);
            }

            // Build a collection of all vehicles that operate on water
            var skidoo  = new Skidoo(10, 1, VehicleColor.Blue);
            var skipper = new SailBoat(0, 5, VehicleColor.Orange);

            List <Watercraft> watercrafts = new List <Watercraft>();

            watercrafts.Add(skidoo);
            watercrafts.Add(skipper);

            // With a single `foreach`, have each water vehicle Drive()
            foreach (var watercraft in watercrafts)
            {
                watercraft.Drive(5);
            }

            Console.ReadKey();
        }
    static void Main(string[] args)
    {
        // create a VolvoC30 object
        VolvoC30 myVolvo = new VolvoC30("Adam Freeman", "Black");

        // create a FordFiesta object
        FordFiesta myFord = new FordFiesta("Joe Smith", "Green");

        // call the PrintCarDetails method on both car objects
        myVolvo.PrintCarDetails();
        myFord.PrintCarDetails();

        // wait for input before exiting
        Console.WriteLine("Press enter to finish");
        Console.ReadLine();
    }
Exemplo n.º 5
0
        public void FordFiestaStandar()
        {
            Vendible auto = new FordFiesta();

            Assert.AreEqual(auto.GetPrecio(), 1500);
        }