예제 #1
0
        public void CorrectAddLemon()
        {
            TyrannoTea t = new TyrannoTea();

            t.AddLemon();
            Assert.True(t.Lemon);
        }
예제 #2
0
        public void ShouldHaveCorrectWhenCallingAddLemon()
        {
            TyrannoTea tea = new TyrannoTea();

            tea.AddLemon();
            Assert.True(tea.Lemon);
        }
예제 #3
0
        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")));
            }
        }
예제 #4
0
        public void TyrannoteaAddLemonShouldNotifyPropertyChanged()
        {
            TyrannoTea tea = new TyrannoTea();

            Assert.PropertyChanged(tea, "Special", () =>
            {
                tea.AddLemon();
            });
        }
예제 #5
0
        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")));
        }
예제 #6
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);
        }
예제 #7
0
        public void SpecialShouldAddLemon()
        {
            TyrannoTea tea = new TyrannoTea();

            tea.AddLemon();
            Assert.Collection <string>(tea.Special,
                                       item =>
            {
                Assert.Equal("Add Lemon", item);
            }
                                       );
        }
예제 #8
0
        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);
        }
예제 #9
0
        public void testTTEventHandlers()
        {
            TyrannoTea j = new TyrannoTea();

            Assert.PropertyChanged(j, "Price", () =>
            {
                j.Size = Size.Large;
            });
            Assert.PropertyChanged(j, "Description", () =>
            {
                j.Size = Size.Medium;
            });
            Assert.PropertyChanged(j, "Special", () =>
            {
                j.HoldIce();
            });
            Assert.PropertyChanged(j, "Special", () =>
            {
                j.AddLemon();
            });
        }
예제 #10
0
 public void ClickSpecial2(object sender, RoutedEventArgs e)
 {
     if (combo != null && combo.Drink is TyrannoTea)
     {
         TyrannoTea t = combo.Drink as TyrannoTea;
         t.AddLemon();
     }
     if (d != null && d is TyrannoTea)
     {
         TyrannoTea t = d as TyrannoTea;
         t.AddLemon();
     }
     if (d != null && d is Water)
     {
         Water j = d as Water;
         j.AddLemon();
     }
     if (combo != null && combo.Drink is JurassicJava)
     {
         Water j = d as Water;
         j.AddLemon();
     }
 }