public void RemoveObject(int id) { // arrange // act var removed = _appService.Remove(id); // assert Assert.IsTrue(removed); Assert.IsNull(_appService.GetById(id)); }
public ActionResult DeleteConfirmed(Guid id) { var expenseFound = _expenseApp.GetById(id).To <ExpenseViewModel>(); if (expenseFound != null) { var expenseModel = expenseFound.To <Expense>(); _expenseApp.Remove(expenseModel); } return(Json(expenseFound, JsonRequestBehavior.AllowGet)); }
public IActionResult DeleteConfirmed(long id) { _service.Remove(id); return(RedirectToAction(nameof(Index))); }