private void HeatWater(FluentCoffee water) { for (int i = water.Temperature; i < water.CoffeeTemp; i++) { Thread.Sleep(300); water.Temperature++; Console.WriteLine($"Current Temperature {i}"); } Console.WriteLine("Coffee is Ready"); }
static void Main(string[] args) { var espresso = new FluentCoffee() .CoffeeName(Coffee.Espresso) .AddBeans(Beans.Liberia) .GrindBeans(true) .AddWater(new FluentCoffee { Amount = 30, Temperature = 85, CoffeeTemp = 90 }) .Validate(x => x.Temperature < x.CoffeeTemp) .Serve(); Console.WriteLine(espresso); var espresso2 = new FluentCoffee() .CoffeeName("Espresso") .AddBeans("Liberia") .GrindBeans(true) .AddWater(new FluentCoffee { Amount = 30, Temperature = 88, CoffeeTemp = 100 }) .Validate(x => x.Temperature < x.CoffeeTemp) .Serve(); Console.WriteLine(espresso); var mocha = new FluentCoffee() .CoffeeName(Coffee.Mocha) .AddBeans(Beans.Robusta) .GrindBeans(true) .AddWater(new FluentCoffee { Amount = 30, Temperature = 87, CoffeeTemp = 90 }) .Validate(x => x.Temperature < x.CoffeeTemp) .AddChocolateSyrup(20) .AddSteamedMilk(25) .AddWhippedCream(20) .Serve(); Console.WriteLine(mocha); var americano = new FluentCoffee() .CoffeeName(Coffee.Americano) .AddBeans(Beans.Arabica) .GrindBeans(true) .AddWater(new FluentCoffee { Amount = 30, Temperature = 90, CoffeeTemp = 95 }) .Validate(x => x.Temperature < x.CoffeeTemp) .Serve(); Console.WriteLine(americano); Console.ReadKey(); }
public IMakeBeverage AddWater(FluentCoffee ml) { Water = ml; return(this); }