public void ShouldSetAsInactiveWhenEvaluateAsInefficient() { var nonconformityViewModel = new AddNonconformityViewModel(); nonconformityViewModel.Description = "Controlled materials stored without proper indication."; _nonconformityService.AddNonconformity(nonconformityViewModel); var nonconformityId = _nonconformityRepository.GetAll().OrderByDescending(p => p.Id).FirstOrDefault().Id; _nonconformityService.EvaluateAsInefficient(nonconformityId); Assert.Equal(StatusEnum.Inactive, _nonconformityRepository.GetById(nonconformityId).Status); }
public IActionResult PutInefficient(int id) { var resultViewModel = _nonconformityService.EvaluateAsInefficient(id); if (!resultViewModel.Success) { return(NotFound(resultViewModel)); } return(new ObjectResult(resultViewModel)); }