public async Task GetGlobalIntuitiveSearchResponseAsync() { PostcodeIoService qasService = new PostcodeIoService(_httpClientWrapper.Object); var result = await qasService.IsPostcodeValidAsync("NG1 5FS", CancellationToken.None); Assert.AreEqual(true, result); _httpClientWrapper.Verify(x => x.GetAsync(It.Is <HttpClientConfigName>(y => y == HttpClientConfigName.PostcodeIo), It.Is <string>(y => y == "postcodes/NG1 5FS/validate"), It.IsAny <CancellationToken>())); }
public async Task GetGlobalIntuitiveFormatResponseAsync() { PostcodeIoService qasService = new PostcodeIoService(_httpClientWrapper.Object); PostCodeIoNearestRootResponse result = await qasService.GetNearbyPostCodesAsync("NG1 5FS", CancellationToken.None); Assert.AreEqual("NG1 5FS", result.Result[0].Postcode); Assert.AreEqual(1, result.Result[0].Distance); _httpClientWrapper.Verify(x => x.GetAsync(It.Is <HttpClientConfigName>(y => y == HttpClientConfigName.PostcodeIo), It.Is <string>(y => y == "postcodes/NG1 5FS/nearest?limit=100&radius=805"), It.IsAny <CancellationToken>())); }