Пример #1
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()}");
        }
Пример #2
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());
        }