Exemple #1
0
        public void CarFacadeReturnsProperCarTest()
        {
            var carFacade = new CarFacade();
            var car       = carFacade.CreateCar(1997, "Audi", 300, 300, Guid.NewGuid(), Color.Pink, EngineType.Diesel);

            Assert.AreEqual(car.ProductionYear, 1997);
            Assert.AreEqual(car.Brand, "Audi");
            Assert.AreEqual(car.KerbWeight, 300);
            Assert.AreEqual(car.MaxVelocity, 300);
            Assert.AreEqual(car.Color, Color.Pink);
            Assert.AreEqual(car.EngineType, EngineType.Diesel);
        }
        public static void Main()
        {
            var car = new CarBuilder()
                      .SetProductionYear(1999)
                      .SetBrand("Audi")
                      .SetMaxVelosity(300)
                      .Build();

            Boat boat = new Boat();

            boat.ChangeMoveStrategy(new DriveStrategy());

            IDecorator vehicle = new Car();

            vehicle = new MachineGunDecorator(vehicle);
            System.Console.WriteLine(vehicle.Weapon());

            CarFacade car1 = new CarFacade();

            car1.CreateCar(1997, "Audi", 3000, 350, Guid.NewGuid(), Color.Black, EngineType.Diesel);


            System.Console.ReadKey();
        }
Exemple #3
0
        static void Main(string[] args)
        {
            var facade = new CarFacade();

            facade.CreateCar();
        }
Exemple #4
0
        static void Main(string[] args)
        {
            CarFacade carFacade = new CarFacade();

            carFacade.CreateCar();
        }