Ejemplo n.º 1
0
        public void Price_returns_one_item_price_when_bag_contains_one_item()
        {
            var burger = new Fries(SamplePrice);
            var bag = new Bag { burger };

            Assert.AreEqual(burger.Price, bag.Price);
        }
Ejemplo n.º 2
0
        public void Ctor_initializes_collection_with_one_elment()
        {
            var fries = new Fries(SamplePrice);

            var bag = new Bag(fries);

            Assert.AreSame(fries, bag.Single());
        }
Ejemplo n.º 3
0
        public void CreateMeal_returns_bag_with_one_Fries_bag()
        {
            var fries = new Fries(SamplePrice);
            _mockMealBuilder.Setup(x => x.GetFries())
                .Returns(fries);
            var friesPack = SetupMealBuilderToPackItem(fries);

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

            Assert.AreSame(friesPack, bag.Single());
        }
Ejemplo n.º 4
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);
        }