コード例 #1
0
 public void AddBeer_WithInvalidBeer_ReturnsFalse()
 {
     var beerservice = new BeerService();
     var beer = new Beer {Name = null};
     bool added = beerservice.AddBeer(beer);
     Assert.IsFalse(added);
 }
コード例 #2
0
 public void AddBeer_WithAValidBeer_AddsBeer()
 {
     var beerservice = new BeerService();
     var beer = new Beer
     {
         Name = "Goofball Beer",
         Type = BeerTypes.Saison,
         Brewery = "McPita's Brewery",
         Description = "made with the finest malts and barley",
         ABV = 7.5m
     };
     bool added = beerservice.AddBeer(beer);
     Assert.IsTrue(added);
 }