public override Order MakeOrderByTimeOfDay(string timeOfDay) { Order currentOrder = null; if (timeOfDay.ToLower() == "morning") { OrderFactory morningOrderFactory = new MorningOrderFactory(); //Creating a morning order with the following limits //1 Entree //1 Side //Unlimited drinks //No deserts currentOrder = new MorningOrder(morningOrderFactory,1,1,99,0); } else if (timeOfDay.ToLower() == "night") { OrderFactory nightOrderFactory = new NightOrderFactory(); //Creating a night order with the following limits //1 Entree //Unlimited Sides //1 drink //1 deserts currentOrder = new NightOrder(nightOrderFactory,1,99,1,1); } return currentOrder; }
public void MakeOrderByTimeOfDayTest1() { DinerOrderBuilding builder = new DinerOrderBuilding(); Order testOrder = builder.MakeOrderByTimeOfDay("night"); OrderFactory nightOrderFactory = new NightOrderFactory(); NightOrder nightOrder = new NightOrder(nightOrderFactory, 1, 99, 1, 1); Assert.AreEqual(testOrder.GetType(), nightOrder.GetType()); }
public void AddSideTest() { OrderFactory orderFactory = new NightOrderFactory(); Dish side = orderFactory.AddSide(); Assert.AreEqual(side.GetType(), new Potato().GetType()); }
public void AddInvalidDishTest() { OrderFactory orderFactory = new NightOrderFactory(); Dish invalid = orderFactory.AddInvalidDish(); Assert.AreEqual(invalid.Name, "error"); }
public void AddEntreeTest() { OrderFactory orderFactory = new NightOrderFactory(); Dish entree = orderFactory.AddEntree(); Assert.AreEqual(entree.GetType(), new Steak().GetType()); }
public void AddDrinkTest() { OrderFactory orderFactory = new NightOrderFactory(); Dish drink = orderFactory.AddDrink(); Assert.AreEqual(drink.GetType(), new Wine().GetType()); }
public void AddDesertTest() { OrderFactory orderFactory = new NightOrderFactory(); Dish desert = orderFactory.AddDesert(); Assert.AreEqual(desert.GetType(), new Cake().GetType()); }