예제 #1
0
        public void Delete_DeletesBeerInDatabase_BeerList()
        {
            Beer testBeer = new Beer(1, "Tecate", "Lager", 4.5, 15);

            testBeer.Save();
            testBeer.Delete();
            List <Beer> resultList = Beer.GetAll();
            List <Beer> testList   = new List <Beer> {
            };

            CollectionAssert.AreEqual(testList, resultList);
        }
예제 #2
0
        public void EliminarCerveza()
        {
            int  ultimaId = ObtenerUltimaID();
            Beer cerveza  = new Beer(ultimaId);

            bool seElimino = cerveza.Delete();
            // confirmamos
            Beer cervezaEliminada = new Beer(ultimaId);

            bool noExiste = cervezaEliminada.Id < 1;

            Assert.IsTrue(seElimino && noExiste, $"No elimino de la base de datos");
        }