public void EFCanUpdate(int id, string title, int releaseYear, string rating, string director, string notes, bool expected) { bool actual = false; Dvd dvd = new Dvd { DvdId = id, Title = title, ReleaseYear = releaseYear, Rating = rating, Director = director, Notes = notes }; var repo = new DvdRepositoryEF(); Dvd dvdCheck = repo.Get(id); if (dvdCheck != null) { repo.Update(dvd); dvdCheck = repo.Get(id); if (dvdCheck.Title == "Test") { actual = true; } } Assert.AreEqual(expected, actual); }
public void EFCanDelete(int id, bool expected) { bool actual = false; var repo = new DvdRepositoryEF(); Dvd dvd = repo.Get(id); if (dvd != null) { repo.Delete(id); dvd = repo.Get(id); if (dvd == null) { actual = true; } } Assert.AreEqual(expected, actual); }
public void EFGetTest(int id, bool expected) { var repo = new DvdRepositoryEF(); Dvd dvd = repo.Get(id); bool actual = false; if (dvd != null) { actual = true; } Assert.AreEqual(expected, actual); }