public override void Setup() { _request = new GetErrorMessageRequest() { Key = "ErrorCode_Sample", Language = "" }; }
public async Task <GetErrorMessageResponse> GetErrorMessage(GetErrorMessageRequest request) { if (String.IsNullOrEmpty(request.Language)) { return(new GetErrorMessageResponse() { Notifications = new ValidationResult(nameof(ErrorResources.LanguageIsEmpty)) }); } if (String.IsNullOrEmpty(request.Key)) { return(new GetErrorMessageResponse() { Notifications = new ValidationResult(nameof(ErrorResources.ResourceKeyIsEmpty)) }); } var response = await _proxy.CallAsync(c => c.GetAsync($"{_route}/{request.Language}/{request.Key}")); return(await response.Deserialize <GetErrorMessageResponse>()); }
public async Task <ActionResult <GetErrorMessageResponse> > GetErrorMessage([FromRoute] GetErrorMessageRequest request) { var response = await _errorMessagesService.GetErrorMessage(request); return(base.Ok(response)); }
public override void Setup() { _request = new GetErrorMessageRequestTestDataBuilder().WithLanguage(""); }
public async Task <GetErrorMessageResponse> GetErrorMessage(GetErrorMessageRequest messageRequest) { return(await Query <GetErrorMessageRequest, GetErrorMessageQuery, GetErrorMessageViewModel, GetErrorMessageResponse>(messageRequest)); }
public override void Setup() { _request = new GetErrorMessageRequestTestDataBuilder(); }
public async Task <GetErrorMessageResponse> GetErrorMessage(GetErrorMessageRequest request) { var response = await _proxy.CallAsync(c => c.GetAsync($"{_route}/{request.Language}/{request.Key}")); return(await response.Deserialize <GetErrorMessageResponse>()); }