public void DeleteDVDTest() { var manager = new Manager(); var _dvds = manager.GetAllDVDs(); int count = _dvds.Count(); var dvd1 = _dvds.FirstOrDefault(d => d.Id == 1); var dvd2 = _dvds.FirstOrDefault(d => d.Id == 2); manager.DeleteDVD(dvd2.Id); manager.DeleteDVD(dvd1.Id); bool result = (_dvds.Count == count - 2); Assert.IsTrue(result); }
public ActionResult DeleteDVD(DVD dvd) { var manager = new Manager(); manager.DeleteDVD(dvd.Id); return RedirectToAction("Index", "Home"); }