コード例 #1
0
        public void GetDisplayMealListTest()
        {
            CustomerFormPresentationModel model = new CustomerFormPresentationModel(new Model());

            model.AddMeal(model.FindMealByName("薯條(小包)"));
            model.AddToDisplayMealList();
            Assert.AreEqual(model.GetDisplayMealList()[0].Name, "薯條(小包)");
        }
コード例 #2
0
        public void GetTotalPriceTest()
        {
            CustomerFormPresentationModel model = new CustomerFormPresentationModel(new Model());

            model.AddMeal(model.FindMealByName("薯條(小包)"));
            model.AddMeal(model.FindMealByName("薯條(中包)"));
            model.AddToDisplayMealList();
            Assert.AreEqual(model.GetTotalPrice(), 74);
        }
コード例 #3
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);
        }