// Use this for initialization void Start() { coffeeManager = FindObjectOfType <CoffeeManager> (); thanks = victoryText.GetComponent <Animator> (); GenerateOrder(); }
static void Main(string[] args) { IBeverage coffee = new Coffee { Temperatore = 99, Volume = 120 }; var component = new CoffeeManager(); Console.WriteLine("Component with no decorators: "); Console.WriteLine(component.Prepare(coffee)); Console.WriteLine("----------------------------------------------"); Console.WriteLine("Component with 2 decorators: "); var coffeDeluxDecorators = new MilkDecorator(new SyrupDecorator(component)); Console.WriteLine(coffeDeluxDecorators.Prepare(coffee)); Console.Read(); }
public void CoffeeExists() { DbContextOptions <CoffeeShopDbContext> options = new DbContextOptionsBuilder <CoffeeShopDbContext>().UseInMemoryDatabase("CanCreateCoffee").Options; using (CoffeeShopDbContext context = new CoffeeShopDbContext(options)) { Coffee coffee = new Coffee(); coffee.ID = 1; coffee.Name = "latte"; coffee.Price = 2; coffee.Description = "tasty"; coffee.URL = "www.coffee.com"; CoffeeManager coffeeManager = new CoffeeManager(context); coffeeManager.CoffeeExists(1); var result = context.Coffee.Any(c => c.ID == 1); Assert.False(result); } }
public async void CanCreateCoffee() { DbContextOptions <CoffeeShopDbContext> options = new DbContextOptionsBuilder <CoffeeShopDbContext>().UseInMemoryDatabase("CanCreateCoffee").Options; using (CoffeeShopDbContext context = new CoffeeShopDbContext(options)) { Coffee coffee = new Coffee(); coffee.ID = 1; coffee.Name = "latte"; coffee.Price = 2; coffee.Description = "tasty"; coffee.URL = "www.coffee.com"; CoffeeManager coffeeManager = new CoffeeManager(context); await coffeeManager.CreateCoffee(coffee); var result = context.Coffee.FirstOrDefault(c => c.ID == coffee.ID); Assert.Equal(coffee, result); } }
public List<coffee> getCoffees_WS() { CoffeeManager manager = new CoffeeManager(); return manager.getCoffees_CM(); }
public void changeReceivedStatus_WS(int month, int year, string userName, bool newReceivedStatus) { CoffeeManager manager = new CoffeeManager(); manager.changeReceivedStatus_CM(month, year, userName, newReceivedStatus); }
public int addToOrderTable_WS(string userID, string userName, int quantity, decimal total, int coffeeID, int month, int year) { CoffeeManager manager = new CoffeeManager(); return manager.addToOrderTable_CM(userID, userName, quantity, total, coffeeID, month, year); }
public void updateOrderTable_WS(int quantity, decimal total, int month, int year, int orderID) { CoffeeManager manager = new CoffeeManager(); manager.updateOrderTable_CM(quantity, total, month, year, orderID); }
public void setOrderSubmittedOrderTable_WS(int month, int year, string userID) { CoffeeManager manager = new CoffeeManager(); manager.setOrderSubmittedOrderTable_CM(month, year, userID); }
public void removeRowFromOrderTable_WS(int orderID) { CoffeeManager manager = new CoffeeManager(); manager.removeRowFromOrderTable_CM(orderID); }
public void removeAllRowsFromOrderTable_WS(int month, int year, string userID) { CoffeeManager manager = new CoffeeManager(); manager.removeAllRowsFromOrderTable_CM(month, year, userID); }
public List<order> getOrdersForUser_WS(string userID) { CoffeeManager manager = new CoffeeManager(); return manager.getOrdersForUser_CM(userID); }
public List<coffeeIDandQuantity> getOrdersByMonth_WS(int month, int year) { CoffeeManager manager = new CoffeeManager(); return manager.getOrdersByMonth_CM(month, year); }
public List<orderSummary> getOrdersByMonthForUser_WS(int month, int year, string userName) { CoffeeManager manager = new CoffeeManager(); return manager.getOrdersByMonthForUser_CM(month, year, userName); }
public List<string> getOrderNamesReceived_WS(int month, int year) { CoffeeManager manager = new CoffeeManager(); return manager.getOrderNamesReceived_CM(month, year); }