public void CanEditDvd() { var repo = new DvdRepositoryADO(); //Dvd dvd = new Dvd(); var preEdit = repo.GetDvdById(1); preEdit.Title = "Pimp Chronicles"; preEdit.DirectorName = "Buck Nasty"; repo.EditDvd(preEdit); var postEdit = repo.GetDvdById(1); Assert.AreEqual("Pimp Chronicles", postEdit.Title); Assert.AreEqual("Buck Nasty", postEdit.DirectorName); }
public void GetDvdById() { var repo = new DvdRepositoryADO(); var dvd = repo.GetDvdById(1); Assert.AreEqual("True Hollywood Stories", dvd.Title); Assert.AreEqual(2017, dvd.ReleaseYear); Assert.AreEqual("Charlie Murphy", dvd.DirectorName); Assert.AreEqual("R", dvd.RatingType); }
public void CanAddDvd() { var repo = new DvdRepositoryADO(); Dvd dvdAdd = new Dvd(); dvdAdd.Title = "A Player Hater's Ball"; dvdAdd.ReleaseYear = 1977; dvdAdd.DirectorName = "Silky Johnson"; dvdAdd.RatingType = "G"; dvdAdd.Notes = "The most diabolical haters this side of the Mississippi!"; repo.AddDvd(dvdAdd); var newDvd = repo.GetDvdById(4); Assert.AreEqual("A Player Hater's Ball", newDvd.Title); Assert.AreEqual(1977, newDvd.ReleaseYear); Assert.AreEqual("Silky Johnson", newDvd.DirectorName); Assert.AreEqual("G", newDvd.RatingType); }