public void GetDisplayMealListTest() { CustomerFormPresentationModel model = new CustomerFormPresentationModel(new Model()); model.AddMeal(model.FindMealByName("薯條(小包)")); model.AddToDisplayMealList(); Assert.AreEqual(model.GetDisplayMealList()[0].Name, "薯條(小包)"); }
public void GetTotalPriceTest() { CustomerFormPresentationModel model = new CustomerFormPresentationModel(new Model()); model.AddMeal(model.FindMealByName("薯條(小包)")); model.AddMeal(model.FindMealByName("薯條(中包)")); model.AddToDisplayMealList(); Assert.AreEqual(model.GetTotalPrice(), 74); }
public void DeleteFromDisplayMealListTest() { CustomerFormPresentationModel model = new CustomerFormPresentationModel(new Model()); model.AddMeal(model.FindMealByName("薯條(小包)")); model.AddMeal(model.FindMealByName("薯條(中包)")); model.AddToDisplayMealList(); Assert.AreEqual(model.GetDisplayMealList().Count, 2); model.DeleteFromDisplayMealList("薯條(小包)"); Assert.AreEqual(model.GetDisplayMealList().Count, 1); model.DeleteFromDisplayMealList("薯條(中包)"); Assert.AreEqual(model.GetDisplayMealList().Count, 0); }