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(); }
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()}"); }
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(); }
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()); }
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(); }