public void Save_AddSingleBeerToDB_1() { //Arrange Beer newBeer = new Beer("Alpha IPA", 6.8, 70.0); //Act newBeer.Save(); List <Beer> allBeers = Beer.GetAll(); //Assert Assert.Equal(1, allBeers.Count); }
public void DeleteBeer_RemoveSingleBeerFromDB_0() { //Arrange Beer newBeer = new Beer("Alpha IPA", 6.8, 70.0); //Act newBeer.Save(); Beer.DeleteBeer(newBeer.GetId()); List <Beer> allBeers = Beer.GetAll(); //Assert Assert.Equal(0, allBeers.Count); }
public void GetAll_ReturnAListOfAllBeers_ListOfBeers() { //Arrange Beer beer1 = new Beer("Alpha IPA", 6.8, 70.0); Beer beer2 = new Beer("Beta IPA", 6.8, 70.0); beer1.Save(); beer2.Save(); //Act List <Beer> testBeers = Beer.GetAll(); List <Beer> expectedBeers = new List <Beer> { beer1, beer2 }; //Assert Assert.Equal(expectedBeers, testBeers); }