//delete method public void DeleteBar(int id) { var orig = _barRepo.GetBarById(id); _barRepo.Delete(orig); _barRepo.SaveChanges(); }
public void BarRepository_DeleteExistingBar_BarNoLongerInDB() { var bar = new Bar() { BarName = "New bar", Address = "FakeAddress", AgeLimit = 18, AvgRating = 0, CVR = 88888888, PhoneNumber = 12345678, Educations = "IKT", Email = "Fake@email", ShortDescription = "Short description", LongDescription = "Long description", Image = "FakeImg" }; _repository.Add(bar); _context.SaveChanges(); _repository.Delete("New bar"); _context.SaveChanges(); Assert.AreEqual(null, _repository.Get("New bar")); }