public IActionResult Put(int id, [FromBody] LpcReportModel model) { if (id == 0) { return(BadRequest()); } var validator = new LpcReportRule(); var validationResults = validator.Validate(model); if (!validationResults.IsValid) { return(Json(validationResults.Errors)); } var result = _lpcReportService.GetLPCReport(id); if (result == null) { return(NotFound()); } _lpcReportService.UpdateLPCReport(model); return(new NoContentResult()); }
public void Can_Get_LpcReport() { var sut = _lpcReportService.GetLPCReport(1); Assert.NotNull(sut); Assert.IsType <LpcReportModel>(sut); Assert.NotEmpty(sut.PhotoURL); Assert.NotEmpty(sut.PdfURL); Assert.NotEmpty(sut.MapURL); }