public void CombosOfOptionsWork(bool holdIce, bool addLemon)
        {
            TyrannoTea t = new TyrannoTea();

            if (holdIce)
            {
                t.HoldIce();
            }
            if (addLemon)
            {
                t.AddLemon();
            }
            if (holdIce)
            {
                Assert.True(Array.Exists <string>(t.Special, element => element.Equals("Hold Ice")));
            }
            if (addLemon)
            {
                Assert.True(Array.Exists <string>(t.Special, element => element.Equals("Add Lemon")));
            }
            if (!holdIce)
            {
                Assert.False(Array.Exists <string>(t.Special, element => element.Equals("Hold Ice")));
            }
            if (!addLemon)
            {
                Assert.False(Array.Exists <string>(t.Special, element => element.Equals("Add Lemon")));
            }
        }
 public void ClickSpecial1(object sender, RoutedEventArgs e)
 {
     if (combo != null && combo.Drink is TyrannoTea)
     {
         TyrannoTea t = combo.Drink as TyrannoTea;
         t.Sweet = true;
     }
     if (d != null && d is TyrannoTea)
     {
         TyrannoTea t = d as TyrannoTea;
         t.Sweet = true;
     }
     if (d != null && d is JurassicJava)
     {
         JurassicJava j = d as JurassicJava;
         j.Decaf = true;
     }
     if (combo != null && combo.Drink is JurassicJava)
     {
         JurassicJava j = d as JurassicJava;
         j.Decaf = true;
     }
     if (combo != null && combo.Drink is Sodasaurus)
     {
         NavigationService.Navigate(new ChooseFlavor(combo));
     }
     if (d != null && d is Sodasaurus)
     {
         NavigationService.Navigate(new ChooseFlavor(d as Sodasaurus));
     }
 }
        public void ShouldHaveCorrectCaloriesWhenSweetIsTrueForSmall()
        {
            TyrannoTea tea = new TyrannoTea();

            tea.AddSweet();
            Assert.Equal <uint>(2 * 8, tea.Calories);
        }
        public void ShouldHaveCorrectPriceForMedium()
        {
            TyrannoTea tea = new TyrannoTea();

            tea.Size = Size.Medium;
            Assert.Equal <double>(1.49, tea.Price);
        }
        public void ShouldHaveCorrectCaloriesForMedium()
        {
            TyrannoTea tea = new TyrannoTea();

            tea.Size = Size.Medium;
            Assert.Equal <uint>(16, tea.Calories);
        }
        public void ShouldHaveCorrectWhenCallingHoldIce()
        {
            TyrannoTea tea = new TyrannoTea();

            tea.HoldIce();
            Assert.False(tea.Ice);
        }
        public void ShouldHaveCorrectWhenCallingAddLemon()
        {
            TyrannoTea tea = new TyrannoTea();

            tea.AddLemon();
            Assert.True(tea.Lemon);
        }
        public void ShouldHaveCorrectCaloriesForLarge()
        {
            TyrannoTea tea = new TyrannoTea();

            tea.Size = Size.Large;
            Assert.Equal <uint>(32, tea.Calories);
        }
        public void ShouldHaveCorrectPriceForLarge()
        {
            TyrannoTea tea = new TyrannoTea();

            tea.Size = Size.Large;
            Assert.Equal <double>(1.99, tea.Price);
        }
        public void CorrectAddLemon()
        {
            TyrannoTea t = new TyrannoTea();

            t.AddLemon();
            Assert.True(t.Lemon);
        }
        public void CorrectHeldIce()
        {
            TyrannoTea t = new TyrannoTea();

            t.HoldIce();
            Assert.False(t.Ice);
        }
Exemple #12
0
        public void ShouldHaveCorrectIngedients()
        {
            TyrannoTea tea = new TyrannoTea();

            Assert.Contains <string>("Water", tea.Ingredients);
            Assert.Contains <string>("Tea", tea.Ingredients);
            Assert.Equal <int>(2, tea.Ingredients.Count);
        }
Exemple #13
0
        public void ShouldHaveCorrectPriceForSmall()
        {
            TyrannoTea tea = new TyrannoTea();

            tea.Size = Size.Medium;
            tea.Size = Size.Small;
            Assert.Equal <double>(0.99, tea.Price);
        }
Exemple #14
0
        public void ShouldHaveCorrectCaloriesWhenSweetIsFalseForSmall()
        {
            TyrannoTea tea = new TyrannoTea();

            tea.Sweet = true;
            tea.Sweet = false;
            Assert.Equal <uint>(8, tea.Calories);
        }
Exemple #15
0
        public void AddSweetNotifyOfSpecialPropertyChanged()
        {
            TyrannoTea tea = new TyrannoTea();

            Assert.PropertyChanged(tea, "Calories", () =>
            {
                tea.AddSweet();
            });
        }
        public void TyrannoteaSizeChangeShouldNotifyProperty(Size size, string property)
        {
            TyrannoTea tea = new TyrannoTea();

            Assert.PropertyChanged(tea, property, () =>
            {
                tea.Size = size;
            });
        }
        public void TyrannoteaAddLemonShouldNotifyPropertyChanged()
        {
            TyrannoTea tea = new TyrannoTea();

            Assert.PropertyChanged(tea, "Special", () =>
            {
                tea.AddLemon();
            });
        }
        public void TyrannoteaHoldIceShouldNotifySpecialPropertyChanged()
        {
            TyrannoTea tea = new TyrannoTea();

            Assert.PropertyChanged(tea, "Special", () =>
            {
                tea.HoldIce();
            });
        }
Exemple #19
0
        public void ShouldHaveCorrectCaloriesWhenSweetIsFalseForMedium()
        {
            TyrannoTea tea = new TyrannoTea();

            tea.Sweet = true;
            tea.Sweet = false;
            tea.Size  = Size.Medium;
            Assert.Equal <uint>(16, tea.Calories);
        }
Exemple #20
0
        public void ShouldHaveCorrectCaloriesWhenSweetIsFalseForLarge()
        {
            TyrannoTea tea = new TyrannoTea();

            tea.Sweet = true;
            tea.Sweet = false;
            tea.Size  = Size.Large;
            Assert.Equal <uint>(32, tea.Calories);
        }
Exemple #21
0
        public void ShouldHaveCorrectCaloriesWhenSweetIsTrueForLarge()
        {
            TyrannoTea tea = new TyrannoTea();

            tea.Size = Size.Large;
            tea.AddSweet();

            Assert.Equal <uint>(2 * 32, tea.Calories);
        }
        public void TyrannoteaSetSweetShouldNotifyPropertyDescription()
        {
            TyrannoTea tea = new TyrannoTea();

            Assert.PropertyChanged(tea, "Description", () =>
            {
                tea.Sweet = true;
            });
        }
        public void IndividualHoldsWork()
        {
            TyrannoTea t = new TyrannoTea();

            t.HoldIce();
            Assert.True(Array.Exists <string>(t.Special, element => element.Equals("Hold Ice")));
            t = new TyrannoTea();
            t.AddLemon();
            Assert.True(Array.Exists <string>(t.Special, element => element.Equals("Add Lemon")));
        }
Exemple #24
0
        public void ShouldHaveCorrectIngedientsForWhenLemonIsTrue()
        {
            TyrannoTea tea = new TyrannoTea();

            tea.AddLemon();
            Assert.Contains <string>("Water", tea.Ingredients);
            Assert.Contains <string>("Tea", tea.Ingredients);
            Assert.Contains <string>("Lemon", tea.Ingredients);
            Assert.Equal <int>(3, tea.Ingredients.Count);
        }
Exemple #25
0
        public void ShouldHaveCorrectIngedientsForWhenSweetIsTrue()
        {
            TyrannoTea tea = new TyrannoTea();

            tea.Sweet = true;
            Assert.Contains <string>("Water", tea.Ingredients);
            Assert.Contains <string>("Tea", tea.Ingredients);
            Assert.Contains <string>("Cane Sugar", tea.Ingredients);
            Assert.Equal <int>(3, tea.Ingredients.Count);
        }
        public void CorrectDefaults()
        {
            TyrannoTea t = new TyrannoTea();

            Assert.Equal <Size>(Size.Small, t.Size);
            Assert.Equal <uint>(8, t.Calories);
            Assert.Equal <double>(0.99, t.Price);
            Assert.False(t.Lemon);
            Assert.True(t.Ice);
        }
Exemple #27
0
        public void SpecialShouldAddLemon()
        {
            TyrannoTea tea = new TyrannoTea();

            tea.AddLemon();
            Assert.Collection <string>(tea.Special,
                                       item =>
            {
                Assert.Equal("Add Lemon", item);
            }
                                       );
        }
Exemple #28
0
        public void SpecialShouldHoldIce()
        {
            TyrannoTea tea = new TyrannoTea();

            tea.HoldIce();
            Assert.Collection <string>(tea.Special,
                                       item =>
            {
                Assert.Equal("Hold Ice", item);
            }

                                       );
        }
        public void CheckIngredients()
        {
            TyrannoTea    t = new TyrannoTea();
            List <string> l = new List <string>();

            l.Add("Water");
            l.Add("Tea");
            Assert.Equal <List <string> >(l, t.Ingredients);
            t.AddLemon();
            l.Add("Lemon");
            Assert.Equal <List <string> >(l, t.Ingredients);
            t.Sweet = true;
            l.Add("Cane Sugar");
            Assert.Equal <List <string> >(l, t.Ingredients);
        }
        public void TyrannoTeaToStringShouldGiveNameForSizeAndSweetness(Size size, bool sweet)
        {
            TyrannoTea tea = new TyrannoTea();

            tea.Size  = size;
            tea.Sweet = sweet;
            if (sweet)
            {
                Assert.Equal($"{size} Sweet Tyrannotea", tea.ToString());
            }
            else
            {
                Assert.Equal($"{size} Tyrannotea", tea.ToString());
            }
        }