public async void PostLeft_WhenResponseCreatedReturnsNull_ShouldReturnErrorResponse(string correlationId, BaseRequest <CreateLeftPayLoadRequest> request, IActionResult errorResponse) { _payLoadService.Create(correlationId, request.Data).ReturnsNull(); _responseCreator.ResponseCreated(null).ReturnsNull(); _responseCreator.ResponseError().Returns(errorResponse); var result = await _sut.Post(correlationId, request); result.Should().Be(errorResponse); }
public async Task <IActionResult> Post([FromRoute] string correlationId, [FromBody] BaseRequest <CreateLeftPayLoadRequest> request) { var result = await _payLoadCreateService.Create(correlationId, request.Data); return(_responseCreator.ResponseCreated(result) ?? _responseCreator.ResponseError()); }