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>());
        }
Esempio n. 3
0
        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("");
 }
Esempio n. 5
0
 public async Task <GetErrorMessageResponse> GetErrorMessage(GetErrorMessageRequest messageRequest)
 {
     return(await Query <GetErrorMessageRequest, GetErrorMessageQuery,
                         GetErrorMessageViewModel, GetErrorMessageResponse>(messageRequest));
 }
Esempio n. 6
0
 public override void Setup()
 {
     _request = new GetErrorMessageRequestTestDataBuilder();
 }
Esempio n. 7
0
        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>());
        }