public IHttpActionResult Delete(int dvdId) { _dvdRepository.Delete(dvdId); return(Ok(_dvdRepository.GetAll())); // DvdRepoMock.Delete(dvdId); // return Ok(DvdRepoMock.GetAll()); }
public void Delete(int dvdId) { dvds = _dvdRepository.GetAll(); dvds.RemoveAll(d => d.DvdId == dvdId); _dvdRepository.Delete(dvdId); }
public void DeleteDvd(int id) { IDvdRepository repo = DataFactory.Get(); repo.Delete(id); Dvd dvd = repo.Get(id); Assert.AreEqual(dvd, null); }
public IHttpActionResult Delete(int id) { Dvd dvd = repo.GetById(id); if (dvd == null) { return(NotFound()); } repo.Delete(id); return(Ok()); }
public IHttpActionResult Delete(int dvdID) { DVD dvd = repository.Get(dvdID); if (dvd == null) { return(NotFound()); } repository.Delete(dvdID); return(Ok()); }
// DELETE api/<controller>/5 public IHttpActionResult Delete(int id) { Dvd dvds = _repo.Get(id); if (dvds == null) { return(NotFound()); } else { _repo.Delete(dvds.dvdId); return(Ok()); } }
public void FullCRRRRRRUDTest() { Dvd testDvd = new Dvd { title = "Test DVD", director = "Testing", rating = "R", realeaseYear = "2019", notes = "If you can see this, the test didn't edit itself properly." }; testDvd = _repo.Create(testDvd); Assert.AreEqual(testDvd.notes, _repo.Read(testDvd.dvdId).notes); testDvd.notes = "If you can see this, the test didn't clean itself up properly."; _repo.Update(testDvd); Assert.AreEqual(testDvd.notes, _repo.Read(testDvd.dvdId).notes); Assert.IsNotEmpty(_repo.ReadAll(), "Could not read all"); Assert.IsNotEmpty(_repo.ReadByDirector("Testing"), "Could not read by director"); Assert.IsNotEmpty(_repo.ReadByRating("R"), "Could not read by rating"); Assert.IsNotEmpty(_repo.ReadByTitle("Test DVD"), "Could not read by title"); Assert.IsNotEmpty(_repo.ReadByYear("2019"), "Could not read by year"); _repo.Delete(testDvd.dvdId); Assert.IsNull(_repo.Read(testDvd.dvdId).rating); }
public IHttpActionResult Delete(int id) { _repo.Delete(id); return(StatusCode(HttpStatusCode.NoContent)); }
public void Delete(int id) { _repo.Delete(id); }
public void Delete(int id) { _dvdRepository.Delete(id); }
public void DeleteDvd(int id) { IDvdRepository DvdRepo = DvdRepositoryFactory.Create(); DvdRepo.Delete(id); }
public void Delete(int id) { repos.Delete(id); }