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 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); }
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); }
public void IsAddButtonEnableTest() { CustomerFormPresentationModel model = new CustomerFormPresentationModel(new Model()); Assert.IsFalse(model.IsAddButtonEnable()); model.AddMeal(model.FindMealByName("大麥克")); Assert.IsTrue(model.IsAddButtonEnable()); }
public void GetMealButtonCategoryIndexTest() { CustomerFormPresentationModel model = new CustomerFormPresentationModel(new Model()); Assert.AreEqual(model.GetMealButtonCategoryIndex(model.FindMealByName("大麥克")), 0); }
public void FindMealByNameTest() { CustomerFormPresentationModel model = new CustomerFormPresentationModel(new Model()); Assert.AreEqual("大麥克", model.FindMealByName("大麥克").Name); }