public void DeleteOwner_NonExistingId_ThrowsNullReferenceException() { Mock <IOwnerRepository> ownerRepository = new Mock <IOwnerRepository>(); OwnerService ownerService = new OwnerService(ownerRepository.Object); Action actual = () => ownerService.Delete(1); Assert.Throws <NullReferenceException>(actual); }
public ActionResult Delete(int id) { var model = Service.Delete(id); return(null); }
public async Task <ActionResult> DeleteConfirm(Guid id) { await ownerService.Delete(id); return(RedirectToAction("Index")); }