public void ShouldSetDrink()
        {
            ComboItem combo = new ComboItem();
            MockDrinkImplementation mock = new MockDrinkImplementation(0, 0);

            combo.Drink = mock;
            Assert.Equal(mock, combo.Drink);
        }
Example #2
0
        public void ShouldAddDrinks(double price, uint calories)
        {
            Order order = new Order();
            MockDrinkImplementation mdi = new MockDrinkImplementation(price, calories);

            order.Add(mdi);
            Assert.Contains(mdi, order);
        }
        public void ShouldFireSpecialInstructionsPropChangedOnDrinkChange()
        {
            ComboItem combo = new ComboItem();
            MockDrinkImplementation mock = new MockDrinkImplementation(0, 0);

            Assert.PropertyChanged(combo, "SpecialInstructions", () => {
                combo.Drink = mock;
            });
        }
        public void ShouldFirePricePropChangedOnDrinkChange()
        {
            ComboItem combo = new ComboItem();
            MockDrinkImplementation mock = new MockDrinkImplementation(0, 0);

            Assert.PropertyChanged(combo, "Price", () => {
                combo.Drink = mock;
            });
        }
        public void DrinkForwardsItemNameChange()
        {
            ComboItem combo = new ComboItem();
            MockDrinkImplementation mock = new MockDrinkImplementation(0, 0);

            combo.Drink = mock;
            Assert.PropertyChanged(combo, "SpecialInstructions", () => {
                mock.Size = Size.Large;
            });
        }
        public void DrinkForwardsSpecialInstructionsChange()
        {
            ComboItem combo = new ComboItem();
            MockDrinkImplementation mock = new MockDrinkImplementation(0, 0);

            combo.Drink = mock;
            Assert.PropertyChanged(combo, "SpecialInstructions", () => {
                mock.AddInstruction("An Instruction");
            });
        }
        public void DrinkForwardsCaloriesChange()
        {
            ComboItem combo = new ComboItem();
            MockDrinkImplementation mock = new MockDrinkImplementation(0, 0);

            combo.Drink = mock;
            Assert.PropertyChanged(combo, "Calories", () => {
                mock.ChangeCalories(10);
            });
        }
        public void DrinkForwardsPriceChange()
        {
            ComboItem combo = new ComboItem();
            MockDrinkImplementation mock = new MockDrinkImplementation(0, 0);

            combo.Drink = mock;
            Assert.PropertyChanged(combo, "Price", () => {
                mock.ChangePrice(10);
            });
        }
        public void ShouldGetSpecialInstructions()
        {
            ComboItem combo = new ComboItem();
            MockEntreeImplementation entree = new MockEntreeImplementation(0, 0);

            combo.Entree = entree;
            entree.AddInstruction("Entree Instructions");
            MockDrinkImplementation drink = new MockDrinkImplementation(0, 0);

            combo.Drink = drink;
            drink.AddInstruction("Drink Instructions");
            MockSideImplementation side = new MockSideImplementation(0, 0);

            combo.Side = side;
            side.AddInstruction("Side Instructions");
            Assert.Collection(combo.SpecialInstructions,
                              item => Assert.Equal(entree.ToString(), item),
                              item => Assert.Equal(" - Entree Instructions", item),
                              item => Assert.Equal(side.ToString(), item),
                              item => Assert.Equal(" - Side Instructions", item),
                              item => Assert.Equal(drink.ToString(), item),
                              item => Assert.Equal(" - Drink Instructions", item)
                              );
        }