public IActionResult Post(NonConf nonConf) { ServiceResponse <GetNonConfDto> serviceResponse = _nonConfService.AddNonConf(nonConf); if (serviceResponse.Data == null) { return(BadRequest(serviceResponse.Message)); } return(Ok(serviceResponse)); }
public void Post_ShouldInsertANewCorrActionInANonConf() { CorrActionDto corrAction = new CorrActionDto() { Id = 1, Description = "Do Anything." }; _nonConfService.AddNonConf(new NonConf() { Id = 1 }); _corrActionService.AddCorrAction(corrAction); NonConfCorrActionsDto nonConfCorrActions = new NonConfCorrActionsDto() { NonconfId = 1, CorractionId = 1 }; _nonConfCorrActionsService.AddNonConfCorrActions(nonConfCorrActions); List <CorrActionDto> corrActionsInNonConf = _nonConfService.GetNonConfById(1).Data.CorrActions; Assert.Equal(corrAction.Id, corrActionsInNonConf[0].Id); }
public void Post_ShouldAddNewNonConf() { _serviceResponse = _nonConfService.AddNonConf(new NonConf()); Assert.IsType <GetNonConfDto>(_serviceResponse.Data); }