示例#1
0
        public void ShouldUseCorrectCaloriesForMedium()
        {
            SodaSaurus ss = new SodaSaurus();

            ss.Size = Size.Medium;
            Assert.Equal <uint>(156, ss.Calories);
        }
示例#2
0
        public void ShouldUseCorrectPriceForLarge()
        {
            SodaSaurus ss = new SodaSaurus();

            ss.Size = Size.Large;
            Assert.Equal(2.5, ss.Price, 2);
        }
示例#3
0
        public void ShouldBeAbleToSetSizeToMedium()
        {
            SodaSaurus ss = new SodaSaurus();

            ss.Size = Size.Medium;
            Assert.Equal <Size>(Size.Medium, ss.Size);
        }
示例#4
0
        public void ShouldUseCorrectCaloriesForLarge()
        {
            SodaSaurus ss = new SodaSaurus();

            ss.Size = Size.Large;
            Assert.Equal <uint>(208, ss.Calories);
        }
示例#5
0
        public void ShouldBeAbleToHoldIce()
        {
            SodaSaurus ss = new SodaSaurus();

            ss.HoldIce();
            Assert.False(ss.Ice);
        }
示例#6
0
        public void ShouldBeAbleToSetSizeToLarge()
        {
            SodaSaurus ss = new SodaSaurus();

            ss.Size = Size.Large;
            Assert.Equal <Size>(Size.Large, ss.Size);
        }
示例#7
0
        public void ShouldUseCorrectPriceForMedium()
        {
            SodaSaurus ss = new SodaSaurus();

            ss.Size = Size.Medium;
            Assert.Equal(2.0, ss.Price, 2);
        }
示例#8
0
        public void SpecialShouldRemoveIce()
        {
            SodaSaurus ss = new SodaSaurus();

            ss.HoldIce();
            Assert.Collection <string>(ss.Special,
                                       item => { Assert.Equal("Hold Ice", item); });
        }
示例#9
0
        public void SodaSaurusToStringShouldGiveNameForSizeAndFlavor(Size size, SodasaurusFlavor flavor)
        {
            SodaSaurus soda = new SodaSaurus();

            soda.Size   = size;
            soda.Flavor = flavor;
            Assert.Equal($"{size} {flavor} Sodasaurus", soda.ToString());
        }
示例#10
0
 public DrinkSelection(SodaSaurus soda)
 {
     InitializeComponent();
     DecafButton.IsEnabled = false;
     SweetButton.IsEnabled = false;
     LemonButton.IsEnabled = false;
     drink = soda;
 }
        public void SodasaurusChangeSizeShouldNotifyProperty(Size size, string property)
        {
            SodaSaurus soda = new SodaSaurus();

            Assert.PropertyChanged(soda, property, () =>
            {
                soda.Size = size;
            });
        }
        public void SodasaurusChangeFlavorShouldNotifyPropertyDescription(SodasaurusFlavor flavor)
        {
            SodaSaurus soda = new SodaSaurus();

            Assert.PropertyChanged(soda, "Description", () =>
            {
                soda.Flavor = flavor;
            });
        }
示例#13
0
        public void ChangingToLargeShouldNotifyOfPricePropertyChange()
        {
            SodaSaurus ss = new SodaSaurus();

            Assert.PropertyChanged(ss, "Price", () =>
            {
                ss.Size = Size.Large;
            });
        }
示例#14
0
        public void ChangingToLargeShouldNotifyOfDescriptionPropertyChange()
        {
            SodaSaurus ss = new SodaSaurus();

            Assert.PropertyChanged(ss, "Description", () =>
            {
                ss.Size = Size.Large;
            });
        }
示例#15
0
        public void ShouldHaveCorrectIngedients()
        {
            SodaSaurus ss = new SodaSaurus();

            Assert.Contains <string>("Water", ss.Ingredients);
            Assert.Contains <string>("Natural Flavors", ss.Ingredients);
            Assert.Contains <string>("Cane Sugar", ss.Ingredients);
            Assert.Equal <int>(3, ss.Ingredients.Count);
        }
        public void SodasaurusHoldIceShouldNotifyPropertySpecial()
        {
            SodaSaurus soda = new SodaSaurus();

            Assert.PropertyChanged(soda, "Special", () =>
            {
                soda.HoldIce();
            });
        }
示例#17
0
        public void SettingFlavorToLimeShouldNotifyOfDescriptionPropertyChange()
        {
            SodaSaurus ss = new SodaSaurus();

            Assert.PropertyChanged(ss, "Description", () =>
            {
                ss.Flavor = SodasaurusFlavor.Lime;
            });
        }
示例#18
0
        public void ChangingToSmallShouldNotifyOfDescriptionPropertyChange()
        {
            SodaSaurus ss = new SodaSaurus();

            ss.Size = Size.Medium;
            Assert.PropertyChanged(ss, "Description", () =>
            {
                ss.Size = Size.Small;
            });
        }
示例#19
0
        public void ShouldHaveCorrectDefaultPrice()
        {
            SodaSaurus ss = new SodaSaurus();

            Assert.Equal(1.50, ss.Price, 2);
        }
示例#20
0
        public void ShouldHaveCorrectDefaultCalories()
        {
            SodaSaurus ss = new SodaSaurus();

            Assert.Equal <uint>(112, ss.Calories);
        }
示例#21
0
        public void ShouldHaveCorrectDefaultSize()
        {
            SodaSaurus ss = new SodaSaurus();

            Assert.Equal <Size>(Size.Small, ss.Size);
        }