コード例 #1
0
        public IActionResult AddNonConfCorrAction(NonConfCorrActionsDto newNonConfCorrAction)
        {
            ServiceResponse <GetNonConfDto> serviceResponse = _nonConfCorrActionsService.AddNonConfCorrActions(newNonConfCorrAction);

            if (serviceResponse.Success == false)
            {
                return(BadRequest(serviceResponse.Message));
            }

            return(Ok(serviceResponse));
        }
コード例 #2
0
        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);
        }