public IActionResult Verify([FromBody] ExtractDbProtocolDTO entity) { if (null == entity) { return(BadRequest()); } if (!entity.IsValid()) { return(BadRequest()); } try { var verified = _extractManagerService.Verfiy(entity.Extract, entity.DatabaseProtocol); return(Ok(verified)); } catch (Exception e) { var msg = $"Error parsing {nameof(Extract)} {_extractManagerService.GetDatabaseError()}"; Log.Error(msg); Log.Error($"{e}"); return(StatusCode(500, msg)); } }
public void should_Post_Verify_Extract_Query() { var extractDbProtocolDTO = new ExtractDbProtocolDTO(_iqcareExtract, _mssql); var response = _extractManagerController.Verify(extractDbProtocolDTO); var result = response as OkObjectResult; Assert.IsNotNull(result); Assert.AreEqual(200, result.StatusCode); Assert.True(Convert.ToBoolean(result.Value)); }