public async Task <IActionResult> Delete([FromQuery(Name = "id")] int id) { var professor = await _service.GetProfessor(id); if (professor == null) { return(NotFound()); } _service.DeleteProfessor(professor); return(NoContent()); }
public void GivenAProfessorService_WhenCallingDeleteProfessor_ThenProfessorIsDeleted() { //Given var professorService = new ProfessorService(); //When professorService.DeleteProfessor(1); var actual = professorService.GetAllProfessors(); //Then Assert.Equal(3, actual.Count); }