Ejemplo n.º 1
0
        public void CreateMeal_returns_bag_with_one_Burger_bag()
        {
            var burger = new Burger(BurgerTypes.Chicken, SamplePrice);
            _mockMealBuilder.Setup(x => x.GetBurger(BurgerTypes.Chicken))
                .Returns(burger);
            var burgerPack = SetupMealBuilderToPackItem(burger);

            var bag = _waiter.CreateMeal(new Order(BurgerTypes.Chicken, DrinkTypes.Cola, ToyTypes.Car));

            Assert.AreSame(burgerPack, bag.Single());
        }
Ejemplo n.º 2
0
        public void Price_returns_sum_of_all_packed_item_prices()
        {
            var burger = new Burger(BurgerTypes.Vegetable, SamplePrice);
            var drink = new Drink(DrinkTypes.Cola, SamplePrice);
            var fries = new Fries(SamplePrice);
            var bag = new Bag { burger, drink, fries };
            var toy = new Toy(ToyTypes.Car, SamplePrice);

            var mealBag = new Bag { bag, toy };

            Assert.AreEqual((burger.Price + drink.Price + fries.Price + toy.Price), mealBag.Price);
        }
        public void Pack_fills_bag_with_meal_item()
        {
            var burger = new Burger(BurgerTypes.Vegetable, 1m);

            var bag = _operations.Pack(burger);

            Assert.AreSame(burger, ((IEnumerable<IMealItem>) bag).Single());
        }