public void TestDeleteExam() { // Act examService.DeleteExam(id); // Assert Assert.AreEqual(true, boolDelete); }
public IActionResult DeleteStudent(int?examId) { if (examId == null) { return(BadRequest()); } try { _logger.LogInformation("Deleting exam by Id from the database."); examService.DeleteExam(examId); _logger.LogInformation($"Exam by ID {examId} has been deleted."); return(RedirectToAction("Index")); } catch (Exception ex) { _logger.LogError($"Something went wrong: {ex}"); return(StatusCode(500, "Internal server error.")); } }