public When_LocationService_Is_Called_To_Validate_An_Invalid_Postcode() { var locationService = new LocationApiClient(new HttpClient(), new MatchingConfiguration { PostcodeRetrieverBaseUrl = "https://api.postcodes.io/postcodes" }); _result = locationService.IsValidPostcodeAsync("CV1234").GetAwaiter().GetResult(); }
public When_LocationService_Is_Called_To_Validate_A_Valid_Postcode() { const string requestPostcode = "Cv12wT"; var httpClient = new TestPostcodesIoHttpClient().Get(requestPostcode); var locationService = new LocationApiClient(httpClient, new MatchingConfiguration { PostcodeRetrieverBaseUrl = "https://api.postcodes.io/" }); _postcodeResultDto = locationService.IsValidPostcodeAsync(requestPostcode).GetAwaiter().GetResult(); }