Beispiel #1
0
        public void NightPlanShouldNotAllowMoreThanOneDessert()
        {
            var temp = new FoodPlan(FoodPlanType.Night);

            temp.AddItem(DishType.Dessert);
            temp.AddItem(DishType.Dessert);
            var isValid = temp.Validate(DishType.Dessert);

            Assert.AreEqual(false, isValid);
        }
Beispiel #2
0
        public void GetPlansReturnMultipleSides()
        {
            var temp = new FoodPlan(FoodPlanType.Night);

            temp.AddItem(DishType.Side);
            temp.AddItem(DishType.Side);
            var result = temp.GetPlan();

            StringAssert.Contains(result, "x2");
        }
Beispiel #3
0
        public void MorningPlanShouldNotAllowMoreThanOneSide()
        {
            var temp = new FoodPlan(FoodPlanType.Morning);

            temp.AddItem(DishType.Side);
            temp.AddItem(DishType.Side);
            var isValid = temp.Validate(DishType.Side);

            Assert.AreEqual(false, isValid);
        }
Beispiel #4
0
        public void GetPlansReturnMultipleDrinks()
        {
            var temp = new FoodPlan(FoodPlanType.Morning);

            temp.AddItem(DishType.Drink);
            temp.AddItem(DishType.Drink);
            temp.AddItem(DishType.Drink);
            var result = temp.GetPlan();

            StringAssert.Contains(result, "x3");
        }
Beispiel #5
0
        public void NightPlanShouldAllowMoreThanOneSide()
        {
            var temp = new FoodPlan(FoodPlanType.Night);

            temp.AddItem(DishType.Side);
            temp.AddItem(DishType.Side);
            var isValid = temp.Validate(DishType.Side);

            Assert.AreEqual(2, temp.SideCount);
            Assert.AreEqual(true, isValid);
        }
Beispiel #6
0
        public void MorningPlanShouldAllowMoreThanOneDrink()
        {
            var temp = new FoodPlan(FoodPlanType.Morning);

            temp.AddItem(DishType.Drink);
            temp.AddItem(DishType.Drink);
            var isValid = temp.Validate(DishType.Drink);

            Assert.AreEqual(2, temp.DrinkCount);
            Assert.AreEqual(true, isValid);
        }
        protected FoodPlan SetupValidBaseFoodPlan()
        {
            var fp = new FoodPlan(FoodPlanType.Morning);

            fp.AddItem(DishType.Entree);
            return(fp);
        }
Beispiel #8
0
        public void AddDishShouldAddDessertToProperBucket()
        {
            var temp = new FoodPlan(FoodPlanType.Morning);

            temp.AddItem(DishType.Dessert);

            Assert.AreEqual(1, temp.DessertCount);
        }
Beispiel #9
0
        public void RemoveDishShouldRemoveSideFromProperBucket()
        {
            var temp = new FoodPlan(FoodPlanType.Morning);

            temp.AddItem(DishType.Side);
            Assert.AreEqual(1, temp.SideCount);
            temp.RemoveItem(DishType.Side);
            Assert.AreEqual(0, temp.SideCount);
        }
Beispiel #10
0
        public void AddInvalidDishShouldThrowException()
        {
            var temp = new FoodPlan(FoodPlanType.Morning);

            temp.AddItem((DishType)7);
        }