Exemplo n.º 1
0
        public void AddLemonShouldNotifySpecialChange()
        {
            Tyrannotea tea = new Tyrannotea();

            tea.AddLemon();
            Assert.PropertyChanged(tea, "Special", () =>
            {
                tea.AddLemon();
            });
        }
Exemplo n.º 2
0
        public void CheckPropertyChangedTyrannotea()
        {
            Tyrannotea ft = new Tyrannotea();

            Assert.PropertyChanged(ft, "Price", () => ft.Price *= 2);
            Assert.PropertyChanged(ft, "Size", () => ft.Size    = Size.Medium);
            Assert.PropertyChanged(ft, "Sweet", () => ft.Sweet  = true);
            Assert.PropertyChanged(ft, "Lemon", () => ft.AddLemon());
            Assert.PropertyChanged(ft, "Ice", () => ft.HoldIce());;
            Assert.PropertyChanged(ft, "Special", () => ft.AddLemon());
        }
 /// <summary>
 /// event handler that deals with when the lemon button is clicked, the special for tea changes to add lemon
 /// </summary>
 /// <param name="sender">reference to the control</param>
 /// <param name="args">contains the event data</param>
 void OnAddLemonTea(object sender, RoutedEventArgs args)
 {
     if (combo != null)
     {
         tea.AddLemon();
         combo.Drink = tea;
     }
     else
     {
         tea.AddLemon();
     }
 }
Exemplo n.º 4
0
        public void AddLemonShouldNotifySpecial()
        {
            Tyrannotea tt = new Tyrannotea();

            Assert.PropertyChanged(tt, "Special", () =>
            {
                tt.AddLemon();
            });
            Assert.PropertyChanged(tt, "Ingredients", () =>
            {
                tt.AddLemon();
            });
        }
Exemplo n.º 5
0
        public void AddLemonShouldNotifyIngredientsAndSpecialChange()
        {
            Tyrannotea tyr = new Tyrannotea();

            Assert.PropertyChanged(tyr, "Ingredients", () =>
            {
                tyr.AddLemon();
            });
            Assert.PropertyChanged(tyr, "Special", () =>
            {
                tyr.AddLemon();
            });
        }
Exemplo n.º 6
0
        public void AddLemonShouldNotifyOfSpecialAndIngredientsPropertyChanged()
        {
            Tyrannotea tea = new Tyrannotea();

            Assert.PropertyChanged(tea, "Special", () =>
            {
                tea.AddLemon();
            });
            Assert.PropertyChanged(tea, "Ingredients", () =>
            {
                tea.AddLemon();
            });
        }
Exemplo n.º 7
0
        public void PropertyShouldChangeTyrannotea()
        {
            Tyrannotea tyrannotea = new Tyrannotea();

            Assert.PropertyChanged(tyrannotea, "Price", () => tyrannotea.Size = Size.Large);
            Assert.PropertyChanged(tyrannotea, "Special", () => tyrannotea.AddLemon());
            Assert.PropertyChanged(tyrannotea, "Special", () => tyrannotea.HoldIce());
            Assert.PropertyChanged(tyrannotea, "Special", () => tyrannotea.Sweet  = true);
            Assert.PropertyChanged(tyrannotea, "Calories", () => tyrannotea.Size  = Size.Large);
            Assert.PropertyChanged(tyrannotea, "Calories", () => tyrannotea.Sweet = true);
            Assert.PropertyChanged(tyrannotea, "Size", () => tyrannotea.Size      = Size.Large);
            Assert.PropertyChanged(tyrannotea, "Ingredients", () => tyrannotea.AddLemon());
            Assert.PropertyChanged(tyrannotea, "Ingredients", () => tyrannotea.Sweet = true);
        }
        public void AddLemonNotifies()
        {
            Tyrannotea s = new Tyrannotea();

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

            Assert.PropertyChanged(s, "Ingredients", () =>
            {
                s.AddLemon();
            }
                                   );
        }
Exemplo n.º 9
0
        public void ShouldHaveCorrectSpecialLemon()
        {
            Tyrannotea tea = new Tyrannotea();

            tea.AddLemon();
            Assert.Contains("Add Lemon", tea.Special);
        }
Exemplo n.º 10
0
        public void ShouldHaveCorrectSpecialAfterAddingLemon()
        {
            Tyrannotea t = new Tyrannotea();

            t.AddLemon();
            Assert.Contains <string>("Add Lemon", t.Special);
        }
Exemplo n.º 11
0
        public void AddLemonShouldSetLemonToTrue()
        {
            Tyrannotea tea = new Tyrannotea();

            tea.AddLemon();
            Assert.True(tea.Lemon);
        }
Exemplo n.º 12
0
        public void AddLemonShouldAddLemon()
        {
            Tyrannotea t = new Tyrannotea();

            t.AddLemon();
            Assert.True(t.hasLemon);
        }
Exemplo n.º 13
0
        public void CanAddLemon()
        {
            Tyrannotea t = new Tyrannotea();

            t.AddLemon();
            Assert.True(t.Lemon);
        }
Exemplo n.º 14
0
        /// <summary>
        /// adds lemon to the description of the specified drink
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        private void OnAddLemon(object sender, RoutedEventArgs args)
        {
            if (DataContext is Order order)
            {
                if (drink is Water)
                {
                    water = (Water)drink;
                    water.AddLemon();
                    if (combo != null)
                    {
                        combo.Drink = water;
                    }
                }

                if (drink is Tyrannotea)
                {
                    tea = (Tyrannotea)drink;
                    tea.AddLemon();
                    if (combo != null)
                    {
                        combo.Drink = tea;
                    }
                }
            }
        }
Exemplo n.º 15
0
        public void CorrectAddLemon()
        {
            Tyrannotea s = new Tyrannotea();

            s.AddLemon();
            Assert.True(s.Lemon);
        }
Exemplo n.º 16
0
        public void ShouldAddLemon()
        {
            Tyrannotea tea = new Tyrannotea();

            tea.AddLemon();
            Assert.True(tea.lemon);
        }
Exemplo n.º 17
0
        public void AddLemonResultsInLemonPropertyBeingTrue()
        {
            Tyrannotea tea = new Tyrannotea();

            tea.AddLemon();
            Assert.True(tea.Lemon);
        }
Exemplo n.º 18
0
        public void ShouldHaveCorrectLemonAfterInvokingAddLemon()
        {
            Tyrannotea tea = new Tyrannotea();

            tea.AddLemon();
            Assert.True(tea.Lemon);
        }
Exemplo n.º 19
0
        public void ShouldHaveCorrectDefaultLemon()
        {
            Tyrannotea tea = new Tyrannotea();

            tea.AddLemon();
            Assert.True(tea.Lemon);
        }
Exemplo n.º 20
0
        public void AddLemonShouldContainLemon()
        {
            Tyrannotea tea = new Tyrannotea();

            tea.AddLemon();
            Assert.Contains <string>("Lemon", tea.Ingredients);
        }
Exemplo n.º 21
0
        public void ShouldAddLemon()
        {
            Tyrannotea tea = new Tyrannotea();

            tea.AddLemon();
            Assert.Equal(true, tea.Lemon);
        }
Exemplo n.º 22
0
        public void InvokingAddLemonSetsResultsInLemonPropertyToTrue()
        {
            Tyrannotea tea = new Tyrannotea();

            tea.AddLemon();
            Assert.True(tea.Lemon);
        }
Exemplo n.º 23
0
        public void InvokingAddLemonMakesLemonPropertyTrue()
        {
            Tyrannotea s = new Tyrannotea();

            s.AddLemon();
            Assert.True(s.Lemon);
        }
Exemplo n.º 24
0
        public void ShouldHaveLemonBeTrueAfterAddLemon()
        {
            Tyrannotea tyrannotea = new Tyrannotea();

            tyrannotea.AddLemon();
            Assert.True(tyrannotea.Lemon);
        }
Exemplo n.º 25
0
        public void ShouldHaveLemon()
        {
            Tyrannotea tt = new Tyrannotea();

            tt.AddLemon();
            Assert.True(tt.Lemon);
        }
Exemplo n.º 26
0
        public void HoldingItemsShouldNotifyOfPropertyChange(string s)
        {
            Tyrannotea dn = new Tyrannotea();

            Assert.PropertyChanged(dn, s, () => { dn.HoldIce(); });
            Assert.PropertyChanged(dn, s, () => { dn.AddLemon(); });
        }
Exemplo n.º 27
0
        public void InvokingAddLemonAddsLemonToIngredients()
        {
            Tyrannotea tea = new Tyrannotea();

            tea.AddLemon();
            Assert.Contains <string>("Lemon", tea.Ingredients);
        }
Exemplo n.º 28
0
        public void ShouldHaveLemonSetToTrue()
        {
            Tyrannotea tea = new Tyrannotea();

            tea.AddLemon();
            Assert.True(tea.Lemon);
        }
Exemplo n.º 29
0
        public void ShouldBeAbleToAddLemon()
        {
            Tyrannotea tea = new Tyrannotea();

            tea.AddLemon();
            Assert.True(tea.Lemon);
        }
Exemplo n.º 30
0
        public void ShouldHaveCorrectLemonAfterSetting()
        {
            Tyrannotea tyr = new Tyrannotea();

            tyr.AddLemon();
            Assert.True(tyr.Lemon);
        }