Example #1
0
        public async void GetAllCountryDataAsync_Returns_ListOfCountryData()
        {
            var countryData = await _countryClient.GetAllCountryDataAsync();

            countryData.Should().NotBeNull();
            countryData.Count.Should().BeGreaterThan(0);
        }
        public async Task <IActionResult> GetAllCountryData()
        {
            List <CountryData> allCountryData = null;

            try
            {
                allCountryData = await _countryClient.GetAllCountryDataAsync();
            }
            catch (Exception)
            {
                return(BadRequest("Error while retreiving country data."));
            }

            return(Ok(allCountryData));
        }