Ejemplo n.º 1
0
        public void SweetToUnsweetShouldHaveCorrectCaloriesForMedium()
        {
            Tyrannotea tt = new Tyrannotea();

            tt.Size = Size.Medium;
            tt.AddSweet();
            tt.RemoveSweet();
            Assert.Equal <uint>(16, tt.Calories);
        }
Ejemplo n.º 2
0
        public void DescriptionShouldBeCorrectForSmallWithSweet()
        {
            Tyrannotea tt = new Tyrannotea();

            tt.Size = Size.Medium;
            tt.Size = Size.Small;
            tt.AddSweet();
            Assert.Equal("Small Sweet Tyrannotea", tt.Description);
        }
Ejemplo n.º 3
0
        public void SweetToUnsweetShouldHaveCorrectCaloriesForLarge()
        {
            Tyrannotea tt = new Tyrannotea();

            tt.Size = Size.Large;
            tt.AddSweet();
            tt.RemoveSweet();
            Assert.Equal <uint>(32, tt.Calories);
        }
Ejemplo n.º 4
0
        public void ShouldHaveMediumCaloriesAfterSweet()
        {
            Tyrannotea tea = new Tyrannotea();

            tea.AddSweet();
            tea.Sweet = false;
            tea.Size  = Size.Medium;
            Assert.Equal <uint>(16, tea.Calories);
        }
Ejemplo n.º 5
0
        public void TyrannoteaSetSweetShouldNotifyPropertyDescription()
        {
            Tyrannotea tea = new Tyrannotea();

            Assert.PropertyChanged(tea, "Description", () =>
            {
                tea.AddSweet();
            });
        }
Ejemplo n.º 6
0
        public void ShouldHaveLargeCaloriesAfterSweet()
        {
            Tyrannotea tea = new Tyrannotea();

            tea.AddSweet();
            tea.Sweet = false;
            tea.Size  = Size.Large;
            Assert.Equal <uint>(32, tea.Calories);
        }
Ejemplo n.º 7
0
        public void ShouldHaveSmallCaloriesAfterSweet()
        {
            Tyrannotea tea = new Tyrannotea();

            tea.AddSweet();
            tea.Sweet = false;
            tea.Size  = Size.Small;
            Assert.Equal <uint>(8, tea.Calories);
        }
Ejemplo n.º 8
0
        public void AddSweetShouldNotifyOfPropertyChanged(string propertyName)
        {
            Tyrannotea tea = new Tyrannotea();

            Assert.PropertyChanged(tea, propertyName, () =>
            {
                tea.AddSweet();
            });
        }
Ejemplo n.º 9
0
        public void AddSweetShouldNotifyDescriptionChange()
        {
            Tyrannotea tt = new Tyrannotea();

            Assert.PropertyChanged(tt, "Description",
                                   () =>
            {
                tt.AddSweet();
            });
        }
Ejemplo n.º 10
0
        public void SweetPropertyShouldChangeCalories()
        {
            Tyrannotea tea = new Tyrannotea();

            tea.AddSweet();
            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);
        }
Ejemplo n.º 11
0
        public void ShouldHaveCorrectIngredientsWithSweet()
        {
            Tyrannotea tt = new Tyrannotea();

            tt.AddSweet();
            List <string> ingredients = tt.Ingredients;

            Assert.Contains("Water", ingredients);
            Assert.Contains("Tea", ingredients);
            Assert.Contains("Cane Sugar", ingredients);
            Assert.Equal <int>(3, ingredients.Count);
        }
Ejemplo n.º 12
0
        public void RemovingSweetPropertyShouldDecreaseCalories()
        {
            Tyrannotea tea = new Tyrannotea();

            tea.AddSweet();
            tea.RemoveSweet();
            Assert.Equal <uint>(8, tea.Calories);
            tea.Size = Size.Medium;
            Assert.Equal <uint>(16, tea.Calories);
            tea.Size = Size.Large;
            Assert.Equal <uint>(32, tea.Calories);
        }
Ejemplo n.º 13
0
        public void SpecialShouldAddSugar()
        {
            Tyrannotea tt = new Tyrannotea();

            tt.AddSweet();
            Assert.Collection <string>(tt.Special,
                                       item =>
            {
                Assert.Equal("Add Cane Sugar", item);
            }
                                       );
        }
Ejemplo n.º 14
0
        public void ShouldContainAllIngredients()
        {
            Tyrannotea tea = new Tyrannotea();

            tea.AddLemon();
            tea.AddSweet();
            Assert.Contains <string>("Water", tea.Ingredients);
            Assert.Contains <string>("Tea", tea.Ingredients);
            Assert.Contains <string>("Lemon", tea.Ingredients);
            Assert.Contains <string>("Cane Sugar", tea.Ingredients);
            Assert.Equal(4, tea.Ingredients.Count);
        }
Ejemplo n.º 15
0
        public void ShouldHaveCorrectIngredients()
        {
            Tyrannotea tea = new Tyrannotea();

            Assert.Contains("Water", tea.Ingredients);
            Assert.Contains("Tea", tea.Ingredients);
            Assert.Equal(2, tea.Ingredients.Count);
            tea.AddLemon();
            Assert.Contains("Lemon", tea.Ingredients);
            tea.AddSweet();
            Assert.Contains("Cane Sugar", tea.Ingredients);
        }
Ejemplo n.º 16
0
        public void ShouldAddSweet()
        {
            Tyrannotea tea = new Tyrannotea();

            tea.AddSweet();
            Assert.True(tea.Sweet);
            Assert.Equal <double>(8 * 2, tea.Calories);
            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);
        }
 private void OnAddSweet(object sender, RoutedEventArgs args)
 {
     if (Drink is Tyrannotea)
     {
         Tyrannotea tea = Drink as Tyrannotea;
         tea.AddSweet();
         Drink = tea;
     }
     if (combo != null)
     {
         combo.Drink = Drink;
     }
 }
Ejemplo n.º 18
0
        public void SpecialShouldContainAll()
        {
            Tyrannotea tt = new Tyrannotea();

            tt.AddLemon();
            tt.AddSweet();
            tt.HoldIce();
            Assert.Collection <string>(tt.Special,
                                       item =>
            {
                Assert.Equal("Add Cane Sugar", item);
            },
                                       item =>
            {
                Assert.Equal("Add Lemon", item);
            },
                                       item =>
            {
                Assert.Equal("Hold Ice", item);
            }
                                       );
        }