public void SelectMainDishToDB() { MainDish mainDish = InitializeDishes.InitializeMainDish("ChickenBreast", 2, 1, eMainDish.ChickenBreast); mainDish.Price = 70; Broker broker = new Broker(); string name = broker.Select(mainDish); Assert.AreEqual("ChickenBreast", name); }
public void AddMainDishToDB() { MainDish mainDish = InitializeDishes.InitializeMainDish("chicken", 2, 1, eMainDish.ChickenBreast); mainDish.Price = 30; Broker broker = new Broker(); broker.Insert(mainDish); Assert.AreEqual(eAppetizer.ChickenNuggets, eAppetizer.ChickenNuggets); }
public void UpdateMainDishToDB() { MainDish mainDish = InitializeDishes.InitializeMainDish("ChickenBreast", 2, 1, eMainDish.ChickenBreast); mainDish.Price = 42; Broker broker = new Broker(); broker.Update(mainDish); Assert.AreEqual(eAppetizer.ChickenNuggets, eAppetizer.ChickenNuggets); }
public void InitializeMainDish_SpringChicken() { string name = "Spring Chicken"; int quantity = 2; int dinerSerialNumber = 1; eMainDish mainDishType = eMainDish.SpringChicken; MainDish mainDish = InitializeDishes.InitializeMainDish(name, quantity, dinerSerialNumber, mainDishType); Assert.AreEqual(mainDishType, mainDish.MainDishType); Assert.AreEqual(dinerSerialNumber, mainDish.DinerSerialNumber); Assert.AreEqual(DishRanks.DishesRank[eDishTypes.MainDish], mainDish.MainRank); Assert.AreEqual(name, mainDish.Name); Assert.AreEqual(DishPrices.MainDishPrices[mainDishType], mainDish.Price); Assert.AreEqual(quantity, mainDish.Quantity); Assert.AreEqual(1, mainDish.SecondRank); Assert.AreEqual(DishRanks.MainDishRanks[mainDishType], mainDish.ThirdRank); }
public void OrderTests_SortOrder() { Order order = new Order(); string name = "Spring Chicken"; int quantity = 2; int dinerSerialNumber = 1; eMainDish mainDishType = eMainDish.SpringChicken; MainDish mainDish2 = InitializeDishes.InitializeMainDish(name, quantity, dinerSerialNumber, mainDishType); order.Dishes.Add(mainDish2); name = "Chicken Nuggets"; quantity = 2; dinerSerialNumber = 1; eAppetizer appetizerType = eAppetizer.ChickenNuggets; Appetizer appetizer = InitializeDishes.InitializeAppetizer(name, quantity, dinerSerialNumber, appetizerType); order.Dishes.Add(appetizer); name = "Schnitzel"; quantity = 2; dinerSerialNumber = 1; mainDishType = eMainDish.Schnitzel; MainDish mainDish = InitializeDishes.InitializeMainDish(name, quantity, dinerSerialNumber, mainDishType); order.Dishes.Add(mainDish); name = "Chicken Skewers"; quantity = 2; dinerSerialNumber = 1; appetizerType = eAppetizer.ChickenSkewers; Appetizer appetizer2 = InitializeDishes.InitializeAppetizer(name, quantity, dinerSerialNumber, appetizerType); order.Dishes.Add(appetizer2); order.SortOrder(); Assert.AreEqual(order.Dishes[0].Name, appetizer.Name); Assert.AreEqual(order.Dishes[1].Name, appetizer2.Name); Assert.AreEqual(order.Dishes[2].Name, mainDish.Name); Assert.AreEqual(order.Dishes[3].Name, mainDish2.Name); }