Пример #1
0
        public void CorrectDefaultSweetToString()
        {
            Tyrannotea t = new Tyrannotea();

            t.MakeSweet();
            Assert.Equal("Small Sweet Tyrannotea", t.ToString());
        }
Пример #2
0
        public void CorrectDefaultSweetDescription()
        {
            Tyrannotea t = new Tyrannotea();

            t.MakeSweet();
            Assert.Equal("Small Sweet Tyrannotea", t.Description);
        }
Пример #3
0
        public void MakeSweetShouldAddToDescription()
        {
            Tyrannotea tea = new Tyrannotea();

            tea.MakeSweet();
            Assert.Equal("Small Sweet Tyranno-Tea", tea.Description);
        }
Пример #4
0
        public void ShouldHaveCorrectSpecialInstructions2()
        {
            DinoNuggets        d = new DinoNuggets();
            MeteorMacAndCheese m = new MeteorMacAndCheese();
            Tyrannotea         t = new Tyrannotea();

            d.AddNugget();
            m.MakeLarge();
            t.MakeMedium();
            t.MakeSweet();
            t.HoldIce();
            CretaceousCombo c = new CretaceousCombo(d);

            c.Side  = m;
            c.Drink = t;
            Assert.Collection <string>(c.Special, item =>
            {
                Assert.Equal("1 Extra Nuggets", item);
            },
                                       item =>
            {
                Assert.Equal("Large Meteor Mac and Cheese", item);
            },
                                       item =>
            {
                Assert.Equal("Medium Sweet Tyrannotea", item);
            },
                                       item =>
            {
                Assert.Equal("Hold Ice", item);
            });
        }
Пример #5
0
        public void CorrectLargeSweetDescription()
        {
            Tyrannotea t = new Tyrannotea();

            t.MakeSweet();
            t.Size = Size.Large;
            Assert.Equal("Large Sweet Tyrannotea", t.Description);
        }
Пример #6
0
        public void CorrectMediumSweetDescription()
        {
            Tyrannotea t = new Tyrannotea();

            t.MakeSweet();
            t.Size = Size.Medium;
            Assert.Equal("Medium Sweet Tyrannotea", t.Description);
        }
Пример #7
0
        public void CorrectMediumSweetToString()
        {
            Tyrannotea t = new Tyrannotea();

            t.MakeSweet();
            t.Size = Size.Medium;
            Assert.Equal("Medium Sweet Tyrannotea", t.ToString());
        }
        public void HasCorrectCaloriesAfterSettingToMediumAndSweet()
        {
            Tyrannotea s = new Tyrannotea();

            s.Size = Size.Medium;
            s.MakeSweet();
            Assert.Equal <uint>(32, s.Calories);
        }
        public void HasCorrectCaloriesAfterSettingToLargeAndSweet()
        {
            Tyrannotea s = new Tyrannotea();

            s.Size = Size.Large;
            s.MakeSweet();
            Assert.Equal <uint>(64, s.Calories);
        }
Пример #10
0
        public void CorrectLargeSweetToString()
        {
            Tyrannotea t = new Tyrannotea();

            t.MakeSweet();
            t.Size = Size.Large;
            Assert.Equal("Large Sweet Tyrannotea", t.ToString());
        }
        public void HasCorrectCaloriesAfterSettingToSmallAndSweet()
        {
            Tyrannotea s = new Tyrannotea();

            s.Size = Size.Small;
            s.MakeSweet();
            Assert.Equal <uint>(16, s.Calories);
        }
        public void MakeSweetContainsSugar()
        {
            Tyrannotea s = new Tyrannotea();

            s.MakeSweet();
            Assert.True(s.Sweet);
            Assert.Contains <string>("Cane Sugar", s.Ingredients);
        }
Пример #13
0
        public void ShouldHaveCorrectToString()
        {
            Tyrannotea tea = new Tyrannotea();

            tea.MakeSweet();
            tea.Size = Size.Medium;
            Assert.Equal("Medium Sweet Tyranno-Tea", tea.ToString());
        }
        public void TyrannoteaSetSweetShouldNotifyPropertyDescription()
        {
            Tyrannotea tea = new Tyrannotea();

            Assert.PropertyChanged(tea, "Description", () =>
            {
                tea.MakeSweet();
            });
        }
Пример #15
0
        public void MakeSweetShouldNotifyOfPropertyChange(string propertyName)
        {
            Tyrannotea drink = new Tyrannotea();

            Assert.PropertyChanged(drink, propertyName, () =>
            {
                drink.MakeSweet();
            });
        }
Пример #16
0
        public void CorrectCaloriesAfterSettingLargeAndSweet()
        {
            Tyrannotea drink = new Tyrannotea
            {
                Size = Size.Large
            };

            drink.MakeSweet();
            Assert.Equal <uint>(64, drink.Calories);
        }
Пример #17
0
        public void CorrectCaloriesAfterSettingMediumAndSweet()
        {
            Tyrannotea drink = new Tyrannotea
            {
                Size = Size.Medium
            };

            drink.MakeSweet();
            Assert.Equal <uint>(32, drink.Calories);
        }
Пример #18
0
        public void CorrectCaloriesAfterAddingSweet()
        {
            Tyrannotea tea = new Tyrannotea();

            tea.MakeSweet();
            Assert.Equal <uint>(16, tea.Calories);
            tea.Size = Size.Medium;
            Assert.Equal <uint>(32, tea.Calories);
            tea.Size = Size.Large;
            Assert.Equal <uint>(64, tea.Calories);
        }
Пример #19
0
        public void ShouldHaveCorrectIngedients()
        {
            Tyrannotea tea = new Tyrannotea();

            Assert.Contains <string>("Water", tea.Ingredients);
            Assert.Contains <string>("Tea", tea.Ingredients);
            tea.AddLemon();
            Assert.Contains <string>("Lemon", tea.Ingredients);
            tea.MakeSweet();
            Assert.Contains <string>("Cane Sugar", tea.Ingredients);
        }
Пример #20
0
 /// <summary>
 /// Makes the tea sweet
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="args"></param>
 protected void OnMakeSweet(object sender, RoutedEventArgs args)
 {
     if (Drink != null)
     {
         Tyrannotea tea = (Tyrannotea)Drink;
         tea.MakeSweet();
     }
     if (isCombo)
     {
         NotifyOfPropertyChange("Special");
     }
 }
Пример #21
0
        public void SweetShouldSetProperCaloriesForEachSize()
        {
            Tyrannotea tea = new Tyrannotea();

            tea.MakeSweet();
            tea.Size = Size.Small;
            Assert.Equal <uint>(16, tea.Calories);
            tea.Size = Size.Medium;
            Assert.Equal <uint>(32, tea.Calories);
            tea.Size = Size.Large;
            Assert.Equal <uint>(64, tea.Calories);
        }
        public void CorrectDescription()
        {
            Tyrannotea s = new Tyrannotea();

            s.Size = Size.Large;
            string test = s.Size.ToString() + " Tyrannotea";

            Assert.Equal(test, s.Description);
            s.MakeSweet();
            test = s.Size.ToString() + " Sweet Tyrannotea";
            Assert.Equal(test, s.Description);
        }
        public void MakeSweetNotifies()
        {
            Tyrannotea s = new Tyrannotea();

            Assert.PropertyChanged(s, "Special", () =>
            {
                s.MakeSweet();
            }
                                   );



            Assert.PropertyChanged(s, "Calories", () =>
            {
                s.MakeSweet();
            }
                                   );

            Assert.PropertyChanged(s, "Description", () =>
            {
                s.MakeSweet();
            }
                                   );
        }
        /// <summary>
        /// Acts as changing button depending on if the object is soda, java, or tea
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ChangingButton_Click(object sender, RoutedEventArgs e)
        {
            if (DataContext is Order order)
            {
                if (CollectionViewSource.GetDefaultView(order.Items).CurrentItem is DinoDiner.Menu.CretaceousCombo Combo)
                {
                    if (Combo.Drink is DinoDiner.Menu.JurassicJava java)
                    {
                        JurassicJava j = new JurassicJava();
                        if (java.Decaf)
                        {
                            j.MakeUndecaf();
                            j.Size      = Combo.Size;
                            Combo.Drink = j;
                        }
                        else
                        {
                            j.MakeDecaf();
                            j.Size      = Combo.Size;
                            Combo.Drink = j;
                        }
                    }
                    else if (Combo.Drink is DinoDiner.Menu.Sodasaurus soda)
                    {
                        this.NavigationService.Navigate(new ComboDrinkSideScreen.FlavorSelection());
                    }
                    else if (Combo.Drink is DinoDiner.Menu.Tyrannotea tea)
                    {
                        Tyrannotea t = new Tyrannotea();
                        if (tea.Sweet)
                        {
                            t.MakeUnSweet();
                            t.Size      = Combo.Size;
                            Combo.Drink = t;
                        }
                        else
                        {
                            t.MakeSweet();
                            t.Size      = Combo.Size;
                            Combo.Drink = t;
                        }
                    }
                }

                CollectionViewSource.GetDefaultView(order.Items).Refresh();
            }
        }
Пример #25
0
        public void ShouldHaveCorrectSpecials()
        {
            Tyrannotea t = new Tyrannotea();

            t.AddLemon();
            Assert.Collection(t.Special, item =>
            {
                Assert.Equal("Add Lemon", item);
            });
            t.Lemon = false;
            t.MakeSweet();
            Assert.Collection(t.Special, item =>
            {
                Assert.Equal("Make Sweet", item);
            });
            t.AddLemon();
            string[] specials = new string[] { "Add Lemon", "Make Sweet" };
            Assert.Equal(t.Special, specials);
        }