コード例 #1
0
        public void ShouldBeAbleToSetSize()
        {
            Size test = Size.Small;

            Data.Drinks.WarriorWater drink = new Data.Drinks.WarriorWater();
            drink.Size = Size.Medium;
            Assert.False(test == drink.Size);
        }
コード例 #2
0
 public void ShouldHaveCorrectSpecialInstructions(bool includeIce, bool includeLemon)
 {
     Data.Drinks.WarriorWater drink = new Data.Drinks.WarriorWater();
     drink.Ice   = includeIce;
     drink.Lemon = includeLemon;
     if (!drink.Ice)
     {
         Assert.Contains <string>("Hold ice", drink.SpecialInstructions);
     }
     if (drink.Lemon)
     {
         Assert.Contains <string>("Add lemon", drink.SpecialInstructions);
     }
 }
コード例 #3
0
 public void ShouldReturnCorrectToStringBasedOnSize(Size size, string name)
 {
     Data.Drinks.WarriorWater drink = new Data.Drinks.WarriorWater();
     drink.Size = size;
     Assert.Equal(drink.ToString(), name);
 }
コード例 #4
0
 public void ShouldHaveCorrectCaloriesForSize()
 {
     Data.Drinks.WarriorWater drink = new Data.Drinks.WarriorWater();
     Assert.True(drink.Calories == 0);
 }
コード例 #5
0
 public void ShouldHaveCorrectPriceForSize()
 {
     Data.Drinks.WarriorWater drink = new Data.Drinks.WarriorWater();
     Assert.True(drink.Price == 0.0);
 }
コード例 #6
0
 public void ShouldBeAbleToSetIce()
 {
     Data.Drinks.WarriorWater drink = new Data.Drinks.WarriorWater();
     drink.Ice = false;
     Assert.False(drink.Ice);
 }
コード例 #7
0
 public void ShouldBeSmallByDefault()
 {
     Data.Drinks.WarriorWater drink = new Data.Drinks.WarriorWater();
     Assert.True(drink.Size == Size.Small);
 }
コード例 #8
0
 public void ShouldNotIncludeLemonByDefault()
 {
     Data.Drinks.WarriorWater drink = new Data.Drinks.WarriorWater();
     Assert.False(drink.Lemon);
 }
コード例 #9
0
 public void ShouldIncludeIceByDefault()
 {
     Data.Drinks.WarriorWater drink = new Data.Drinks.WarriorWater();
     Assert.True(drink.Ice);
 }