static void Main(string[] args) { IBeverage beverage = new DarkRoast(); System.Console.WriteLine($"{beverage.GetDescription()}: ${beverage.GetCost()}\n"); beverage = new Soy(beverage); System.Console.WriteLine($"{beverage.GetDescription()}: ${beverage.GetCost()}\n"); beverage = new Whip(beverage); System.Console.WriteLine($"{beverage.GetDescription()}: ${beverage.GetCost()}\n"); beverage = new Mocha(beverage); System.Console.WriteLine($"{beverage.GetDescription()}: ${beverage.GetCost()}\n"); beverage = new Mocha(beverage); System.Console.WriteLine($"{beverage.GetDescription()}: ${beverage.GetCost()}\n"); beverage = new Whip(beverage); System.Console.WriteLine($"{beverage.GetDescription()}: ${beverage.GetCost()}\n"); beverage = new Whip(beverage); System.Console.WriteLine($"{beverage.GetDescription()}: ${beverage.GetCost()}\n"); beverage = new Whip(beverage); System.Console.WriteLine($"{beverage.GetDescription()}: ${beverage.GetCost()}\n"); beverage = new Whip(beverage); System.Console.WriteLine($"{beverage.GetDescription()}: ${beverage.GetCost()}\n"); beverage = new Whip(beverage); System.Console.WriteLine($"{beverage.GetDescription()}: ${beverage.GetCost()}\n"); beverage = new Whip(beverage); System.Console.WriteLine($"{beverage.GetDescription()}: ${beverage.GetCost()}\n"); Console.ReadLine(); }
public void TestDarkRoast() { Beverage beverage = new DarkRoast(); beverage = new Mocha(beverage); beverage = new Soy(beverage); Assert.AreEqual("Dark Roast Coffee, Mocha, Soy $1.34", beverage.GetDescription() + " $" + beverage.Cost()); }
static void Main(string[] args) { Beverage cappuccino = new Cappuccino(); Beverage soyMochaCappuccino = new Soy(new Mocha(cappuccino)); Console.WriteLine(soyMochaCappuccino.GetDescription()); Console.WriteLine("Cost of the Soy Mocha Cappuccino is " + soyMochaCappuccino.GetCost()); Console.ReadLine(); }
public void CanGetDescriptionOfAHouseBlendWithMochAndSoy() { // Arrange var coffee = new Soy(new Mocha(new HouseBlend())); // Act var description = coffee.GetDescription(); // Assert Assert.That(description, Is.EqualTo("House Blend, Mocha, Soy")); }
public void StartBuzz() { Beverage testBeverage = new Decaf(); testBeverage = new Whip(testBeverage); testBeverage = new SteamedMilk(testBeverage); testBeverage = new Soy(testBeverage); Assert.AreEqual("Decaf, Whip, Steamed Milk, Soy", testBeverage.GetDescription()); Assert.AreEqual((double)(1.05 + .10 + .10 + .15), testBeverage.Cost()); }
static void Main(string[] args) { Beverage.Beverage espresso = new Espresso(); Console.WriteLine($"{espresso.GetDescription()}, ${espresso.Cost()}"); Beverage.Beverage soyHouseBlend = new HouseBlend(); soyHouseBlend = new Soy(soyHouseBlend); Console.WriteLine($"{soyHouseBlend.GetDescription()}, ${soyHouseBlend.Cost()}"); Beverage.Beverage doubleMochaWithWhipInDarkRoast = new DarkRoast(); doubleMochaWithWhipInDarkRoast = new Mocha(doubleMochaWithWhipInDarkRoast); doubleMochaWithWhipInDarkRoast = new Mocha(doubleMochaWithWhipInDarkRoast); doubleMochaWithWhipInDarkRoast = new Whip(doubleMochaWithWhipInDarkRoast); Console.WriteLine($"{doubleMochaWithWhipInDarkRoast.GetDescription()}, ${doubleMochaWithWhipInDarkRoast.Cost()}"); Console.ReadKey(); }
static void Main(string[] args) { Beverage bev = new Espresso(); Console.WriteLine(bev.GetDescription() + "- $" + bev.cost()); Beverage bev2 = new DarkRoast(); bev2 = new Soy(bev2); bev2 = new Mocha(bev2); bev2 = new Soy(bev2); Console.WriteLine(bev2.GetDescription() + " - $" + bev2.cost()); Beverage bev3 = new HouseBlend(); bev3 = new Soy(bev3); bev3 = new Mocha(bev3); bev3 = new Whip(bev3); bev3 = new Soy(bev3); bev3 = new Whip(bev3); Console.WriteLine(bev3.GetDescription() + " - $" + bev3.cost()); Console.ReadKey(); }