public void AddMealTest() { CustomerFormPresentationModel model = new CustomerFormPresentationModel(new Model()); model.AddMeal(model.FindMealByName("薯條(小包)")); model.AddMeal(model.FindMealByName("薯條(中包)")); Assert.AreEqual(model.GetMealList()[0].Name, "薯條(小包)"); Assert.AreEqual(model.GetMealList()[1].Name, "薯條(中包)"); }
public void ClearMealListTest() { CustomerFormPresentationModel model = new CustomerFormPresentationModel(new Model()); model.AddMeal(model.FindMealByName("薯條(小包)")); model.AddMeal(model.FindMealByName("薯條(中包)")); Assert.AreEqual(model.GetMealList().Count, 2); model.ClearMealList(); Assert.AreEqual(model.GetMealList().Count, 0); }