static void Main(string[] args) { var machine = new HotDrinkMachine(); machine.MakeDrink(HotDrinkMachine.AvailableDrink.Tea, 100); machine.MakeDrink(HotDrinkMachine.AvailableDrink.Coffee, 150); Console.ReadLine(); }
static void Main(string[] args) { var machine = new HotDrinkMachine(); var tea = machine.MakeDrink(nameof(Tea), 150); tea.Consume(); var coffee = machine.MakeDrink(nameof(Coffee), 70); coffee.Consume(); }
static void Main(string[] args) { var machine = new HotDrinkMachine(); var drink = machine.MakeDrink(AvailableDrink.Chocolate, 300); drink.Consume(); }
static void Main(string[] args) { var machine = new HotDrinkMachine(); var drink = machine.MakeDrink(); drink.Consume(); }
public static void Main() { var machine = new HotDrinkMachine(); var drink = machine.MakeDrink(); drink.Consume(); }
static void Main(string[] args) { var machine = new HotDrinkMachine(); // var drink = machine.MakeDrink(HotDrinkMachine.AvailableDrink.Coffee, 2); var drink = machine.MakeDrink(); drink.Consume(); }
static void Main(string[] args) { var m = new HotDrinkMachine(); //var d = m.MakeDrink(HotDrinkMachine.AvailableDrink.Tea, 5); //d.Consume(); var d = m.MakeDrink(); }
static void Main(string[] args) { var machine = new HotDrinkMachine(); var drink = machine.MakeDrink(); //drink.Consume(); WriteLine("Hello World!"); ReadKey(); }
static void Main(string[] args) { var machine = new HotDrinkMachine(); var drink = machine.MakeDrink(HotDrinkMachine.AvailableDrink.Tea, 100); drink.consumes(); Console.ReadLine(); }
static void Main(string[] args) { var machine = new HotDrinkMachine(); //var drink = machine.MakeDrink(HotDrinkMachine.AvailableDrink.Tea, 300); //drink.Consume(); IHotDrink drink = machine.MakeDrink(); drink.Consume(); }
static void Main(string[] args) { HotDrinkMachine hotDrinkMachine = new HotDrinkMachine(); hotDrinkMachine.MakeDrink(HotDrinkMachine.AvailableDrinks.Coffee, 2).Consume(); WriteLine(""); ReadKey(); // Go to http://aka.ms/dotnet-get-started-console to continue learning how to build a console app! }
// OCP - open close principal static void Main(string[] args) { WriteLine("Abstract Factory Method \n"); var machine = new HotDrinkMachine(); var drink = machine.MakeDrink(); // var drink = machine.MakeDrink(HotDrinkMachine.AvailableDrink.Tea, 100); drink.Consume(); WriteLine(); }
static void Main(string[] args) { var hdm = new HotDrinkMachine(); //var drink = hdm.MakeDrink(HotDrinkMachine.AvailableDrink.Coffee, 100); //drink.Consume(); var drink = hdm.MakeDrink(); drink.Consume(); Console.Read(); }
static void Main(string[] args) { var machine = new HotDrinkMachine(); //var drink = machine.MakeDrink(HotDrinkMachine.AvaibleDrink.Tea, 100); //drink.Consume(); //WriteLine(); //var drink2 = machine.MakeDrink(HotDrinkMachine.AvaibleDrink.Coffee, 100); //drink2.Consume(); //ReadKey(); var drink = machine.MakeDrink(); drink.Consume(); ReadKey(); }