public void AddBeer_WithInvalidBeer_ReturnsFalse() { var beerservice = new BeerService(); var beer = new Beer {Name = null}; bool added = beerservice.AddBeer(beer); Assert.IsFalse(added); }
public bool AddBeer(Beer beer) { if (string.IsNullOrEmpty(beer.Name)) { return false; } return true; }
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); }