Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            ICar         car       = new Suzuki();
            CarDecorator decorator = new OfferPrice(car);

            Console.WriteLine(string.Format("Make :{0}  Price:{1} " + "DiscountPrice : {2}", decorator.Make, decorator.GetPrice().ToString(), decorator.GetDiscountedPrice().ToString()));
            Console.ReadLine();
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            ICar         car       = new Suzuki();
            CarDecorator decorator = new OfferPrice(car);

            Console.WriteLine($"Make: {car.Make} Price: {car.GetPrice().ToString()} " +
                              $"DiscountedPrice: {decorator.GetDiscountedPrice().ToString()}");
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            var car       = new Suzuki();
            var decorator = new OfferPrice(car);

            Console.WriteLine($"Make {decorator.Make} Price {decorator.GetPrice()} + DiscountedPrice {decorator.GetDiscountedPrice()}");

            Console.ReadLine();
        }
Ejemplo n.º 4
0
        public void SuzukiMake_ShouldReturn_Sedan_SuzukiGetPrice_ShouldReurn_Price()
        {
            ICar         car       = new Suzuki();
            CarDecorator decorator = new OfferPrice(car);
            string       actual    = decorator.Make;
            string       expected  = car.Make;

            Assert.Equal(expected, actual);
            Assert.Equal(car.GetPrice(), decorator.GetPrice());
        }
Ejemplo n.º 5
0
        public static void Main(string[] args)
        {
            var hero = new Hero();

            hero.JetAirways(50);
            hero.AirAsia("Rajesh Raverkar");
            hero.Display();
            hero.Test();

            var suzuki = new Suzuki();

            suzuki.Display();
            suzuki.Test();
        }