public IActionResult GetById(int id) { ServiceResponse <CorrActionDto> serviceResponse = _corrActionService.GetCorrActionById(id); if (serviceResponse.Success == false) { return(NotFound(serviceResponse.Message)); } return(Ok(serviceResponse.Data)); }
public void Get_ShouldReturnCorrectCorrActionById() { _corrActionService.AddCorrAction(new CorrActionDto() { Description = "Do Anything1." }); _corrActionService.AddCorrAction(new CorrActionDto() { Description = "Do Anything2." }); _corrActionService.AddCorrAction(new CorrActionDto() { Description = "Do Anything3." }); _serviceResponse = _corrActionService.GetCorrActionById(2); Assert.Equal("Do Anything2.", _serviceResponse.Data.Description); }