public void ShouldReturnCorrectSpecialInstructions()
        {
            var    EWE = new EbonyWarriorEntourage();
            Entree e   = new BriarheartBurger();
            Side   s   = new VokunSalad();
            Drink  d   = new WarriorWater();

            List <string> expectedSpecialInstructions = new List <string>();

            expectedSpecialInstructions.Add(e.ToString());
            expectedSpecialInstructions.AddRange(e.SpecialInstructions);
            expectedSpecialInstructions.Add(s.ToString());
            expectedSpecialInstructions.AddRange(s.SpecialInstructions);
            expectedSpecialInstructions.Add(d.ToString());
            expectedSpecialInstructions.AddRange(d.SpecialInstructions);

            EWE.Entree = e;
            EWE.Side   = s;
            EWE.Drink  = d;

            foreach (string str in EWE.SpecialInstructions)
            {
                Assert.Contains(str, expectedSpecialInstructions);
            }
        }
        public void ShouldReturnCorrectPrice()
        {
            var    EWE           = new EbonyWarriorEntourage();
            double expectedPrice = 10.00;

            Assert.Equal(expectedPrice, EWE.Price);
        }
        public void ShouldReturnCorrectToStringName()
        {
            string expectedName = "Ebony Warrior Entourage";
            var    EWE          = new EbonyWarriorEntourage();

            Assert.Equal(expectedName, EWE.ToStringName);
        }
        public void ShouldReturnCorrectDescription()
        {
            string expectedDescription = "A combo meal with any side, drink, and entree.";
            var    EWE = new EbonyWarriorEntourage();

            Assert.Equal(expectedDescription, EWE.Description);
        }
        public void ShouldBeAbleToSetScreen()
        {
            var    EWE = new EbonyWarriorEntourage();
            object o   = new object();

            EWE.Screen = o;
            Assert.Equal(o, EWE.Screen);
        }
        public void DrinkNameShouldReturnNameOfDrink()
        {
            var EWE   = new EbonyWarriorEntourage();
            var drink = new WarriorWater();

            EWE.Drink = drink;
            Assert.Equal(drink.Name, EWE.DrinkName);
        }
        public void ShouldBeAbleToSetEntree()
        {
            var EWE    = new EbonyWarriorEntourage();
            var entree = new BriarheartBurger();

            EWE.Entree = entree;
            Assert.Equal(entree, EWE.Entree);
        }
        public void ShouldBeAbleToSetDrink()
        {
            var EWE   = new EbonyWarriorEntourage();
            var drink = new WarriorWater();

            EWE.Drink = drink;
            Assert.Equal(drink, EWE.Drink);
        }
        public void SideNameShouldReturnNameOfSide()
        {
            var EWE  = new EbonyWarriorEntourage();
            var side = new VokunSalad();

            EWE.Side = side;
            Assert.Equal(side.Name, EWE.SideName);
        }
        public void ShouldBeAbleToSetSide()
        {
            var EWE  = new EbonyWarriorEntourage();
            var side = new VokunSalad();

            EWE.Side = side;
            Assert.Equal(side, EWE.Side);
        }
        public void EntreeNameShouldReturnNameOfEntree()
        {
            var EWE    = new EbonyWarriorEntourage();
            var entree = new BriarheartBurger();

            EWE.Entree = entree;
            Assert.Equal(entree.Name, EWE.EntreeName);
        }
        public void SettingEntreeShouldNotifySpecialInstructionsProperties()
        {
            var EWE    = new EbonyWarriorEntourage();
            var entree = new BriarheartBurger();

            Assert.PropertyChanged(EWE, "SpecialInstructions", () =>
            {
                EWE.Entree = entree;
            });
        }
        public void SettingDrinkShouldNotifyDrinkNameProperties()
        {
            var EWE   = new EbonyWarriorEntourage();
            var drink = new WarriorWater();

            Assert.PropertyChanged(EWE, "DrinkName", () =>
            {
                EWE.Drink = drink;
            });
        }
        public void SettingSideShouldNotifySpecialInstructionsProperties()
        {
            var EWE  = new EbonyWarriorEntourage();
            var side = new VokunSalad();

            Assert.PropertyChanged(EWE, "SpecialInstructions", () =>
            {
                EWE.Side = side;
            });
        }
        public void SettingSideShouldNotifyCaloriesProperties()
        {
            var EWE  = new EbonyWarriorEntourage();
            var side = new VokunSalad();

            Assert.PropertyChanged(EWE, "Calories", () =>
            {
                EWE.Side = side;
            });
        }
        public void SettingDrinkShouldNotifySpecialInstructionsProperties()
        {
            var EWE   = new EbonyWarriorEntourage();
            var drink = new WarriorWater();

            Assert.PropertyChanged(EWE, "SpecialInstructions", () =>
            {
                EWE.Drink = drink;
            });
        }
        public void SettingEntreeShouldNotifyEntreeNameProperties()
        {
            var EWE    = new EbonyWarriorEntourage();
            var entree = new BriarheartBurger();

            Assert.PropertyChanged(EWE, "EntreeName", () =>
            {
                EWE.Entree = entree;
            });
        }
        public void ShouldReturnCorrectCalories()
        {
            var    EWE = new EbonyWarriorEntourage();
            Entree e   = new BriarheartBurger();
            Side   s   = new VokunSalad();
            Drink  d   = new WarriorWater();

            EWE.Entree = e;
            EWE.Side   = s;
            EWE.Drink  = d;

            uint expectedCalories = e.Calories + s.Calories + d.Calories;

            Assert.Equal(expectedCalories, EWE.Calories);
        }
Пример #19
0
        /// <summary>
        /// Switches the screen to the combo selection screen
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CombosButton_Click(object sender, RoutedEventArgs e)
        {
            if (DataContext is Order o)
            {
                if (sender is Button)
                {
                    EbonyWarriorEntourage    EWE = new EbonyWarriorEntourage();
                    ComboCustomizationScreen CCS = new ComboCustomizationScreen(EWE);
                    EWE.Screen = CCS;

                    BriarheartBurger BB = new BriarheartBurger();
                    BB.Screen  = new EntreeCustomizationScreen(BB);
                    EWE.Entree = BB;

                    DragonbornWaffleFries DWF = new DragonbornWaffleFries();
                    DWF.Screen = new SideCustomizationScreen(DWF);
                    EWE.Side   = DWF;

                    SailorSoda SS = new SailorSoda();
                    SS.Screen = new DrinkCustomizationScreen(SS);
                    EWE.Drink = SS;

                    o.AddItem = EWE;

                    var orderControl = this.FindAncestor <OrderControl>();
                    orderControl?.SwapScreen(CCS);

                    if (orderControl.NavigationTabBorder.Child is NavigationTab NavTab)
                    {
                        NavTab.EWEScreen = EWE.Screen;
                        NavTab.ReturnToItemSelectionScreenBorder.Visibility = Visibility.Hidden;
                        NavTab.ReturnToCurrentComboScreenBorder.Visibility  = Visibility.Visible;
                    }
                    else
                    {
                        throw new NotImplementedException("Should never be reached");
                    }
                }
            }
        }
        public void ShouldImplementINotifyPropertyChanged()
        {
            var EWE = new EbonyWarriorEntourage();

            Assert.IsAssignableFrom <INotifyPropertyChanged>(EWE);
        }