Exemple #1
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);
        }
Exemple #2
0
        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, "薯條(中包)");
        }
Exemple #3
0
        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);
        }
Exemple #4
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);
        }
Exemple #5
0
        public void IsAddButtonEnableTest()
        {
            CustomerFormPresentationModel model = new CustomerFormPresentationModel(new Model());

            Assert.IsFalse(model.IsAddButtonEnable());
            model.AddMeal(model.FindMealByName("大麥克"));
            Assert.IsTrue(model.IsAddButtonEnable());
        }