public void RemoveMealTest() { string name = "可口可樂"; _mealControl.RemoveMeal(name); Assert.AreEqual(22, _mealControl.GetMealListLength()); }
// click delete meal button private void DeleteMeal(object sender, EventArgs e) { if (_mealListBox.SelectedIndex < 0) { return; } string mealName = _mealListBox.SelectedItem.ToString(); _mealListBox.Items.Remove(mealName); _mealControl.RemoveMeal(mealName); _model.UpdateMealList(); _mealControl.SaveMealListToFile(); RefreshMealManagerView(); RefreshCategoryManagerView(); }