public async void GetDiff_OnSuccess_ShouldReturnResponseFromResponseOK(string correlationId, DiffResponse response,
                                                                               IActionResult actionResult)
        {
            _diffService.Get(correlationId).Returns(response);
            _responseCreator.ResponseOK(response).Returns(actionResult);

            var result = await _sut.GetDiff(correlationId);

            result.Should().Be(actionResult);
        }
Ejemplo n.º 2
0
 public ActionResult <string> Get(int id)
 {
     try
     {
         return(Ok(_diffService.Get(id)));
     }
     catch (ArgumentNullException aex)
     {
         return(NotFound(aex.Message));
     }
     catch (Exception ex)
     {
         return(StatusCode(500, ex.Message));
     }
 }
Ejemplo n.º 3
0
        public async Task <IActionResult> GetDiff([FromRoute] string correlationId)
        {
            var result = await _diffAnalyzerService.Get(correlationId);

            return(_responseCreator.ResponseOK(result) ?? _responseCreator.ResponseNotFound());
        }