public ActionResult Delete(int id, FormCollection collection) { Auction auction = auctionservice.GetById(id); auctionservice.Delete(auction); auctionservice.Commit(); return(RedirectToAction("Listeauctions")); }
public void Delete_Entity() { this.mockRepository.Setup(x => x.Delete(It.IsAny <Auction>())); var auctionServices = new AuctionService(this.mockRepository.Object); Action act = () => auctionServices.Delete(new Auction()); act.Should().NotThrow(); }
public void Delete_Null() { this.mockRepository.Setup(x => x.Delete(It.IsAny <DomainModel.Auction>())).Throws(new NullReferenceException()); var auctionServices = new AuctionService(this.mockRepository.Object); Action act = () => auctionServices.Delete(null); act.Should().Throw <NullReferenceException>(); }
public ActionResult Delete(string id) { service.Delete(id); return RedirectToAction("Index"); }