public void Test_StudentIntegration_Delete_ShouldBeOk() { Result resultToDelete = ObjectMother.GetExistentValidResult(_student, _evaluation); _service.Delete(resultToDelete); Result resultFound = _service.Get(resultToDelete.Id); resultFound.Should().BeNull(); }
public void Test_ResultService_Delete_ShouldBeOk() { _evaluation = ObjectMother.GetExistentValidEvaluation(); _student = ObjectMother.GetExistentValidStudent(); Result resultToDelete = ObjectMother.GetExistentValidResult(_student, _evaluation); _mockRepository.Setup(sr => sr.Delete(resultToDelete)); _service.Delete(resultToDelete); _mockRepository.Verify(sr => sr.Delete(resultToDelete)); }
public ActionResult DeleteConfirmed(int id) { Result result = _resultService.Find(id); var examCoreStudentGroupID = result.GeneratedExam.ExamCoreStudentGroupID; _resultService.Delete(result); return(RedirectToAction("Index/", new { examCoreStudentGroupID = examCoreStudentGroupID })); }
public async Task <ActionResult> DeleteConfirm(int id) { try { await _service.Delete(id); return(RedirectToAction("Index")); } catch { return(View()); } }
public async Task <IActionResult> DeleteResult(int id) { try{ resultService.Delete(id); await unitOfWork.CompleteAsync(); } catch (AppException ex) { return(BadRequest(ex.Message)); } return(Ok(id)); }
public ActionResult DeleteResult(int?id) { if (!id.HasValue) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } if (_resultService.GetResult(id.Value) == null) { return(HttpNotFound()); } _resultService.Delete(id.Value); return(RedirectToAction("GetInfoResult")); }
public ActionResult Delete(Guid id) { resultService.Delete(id); return(RedirectToAction("Index")); }
public async Task <ActionResult> Delete(long id) { return(await _resultService.Delete(id)); }