public void AddToDisplayMealListTest() { CustomerFormPresentationModel model = new CustomerFormPresentationModel(new Model()); model.AddMeal(model.FindMealByName("薯條(小包)")); model.AddMeal(model.FindMealByName("薯條(中包)")); model.AddToDisplayMealList(); Assert.AreEqual(model.GetDisplayMealList()[0].Name, "薯條(小包)"); Assert.AreEqual(model.GetDisplayMealList()[1].Name, "薯條(中包)"); }
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); }