public async Task GetDataAsTypeAsync_HttpBinuserAgent_ReturnsUserAgent() { // Arrange var client = new HliHttpClient("http://httpbin.org/", "ip"); // Act var result = await client.GetDataAsTypeAsync <IpResponse>(); // Assert Assert.IsTrue(result.Origin.Length > 0); }
public async Task PostDataAsTypeAsync_HttpBinPost_ReturnsHeaders() { // Arrange var client = new HliHttpClient("http://httpbin.org/", "post"); // Act var result = await client.PostDataAsTypeAsync <HttpBinPost>(null); // Assert Assert.AreEqual("httpbin.org", result.headers.Host); }
public async Task GetDataAsTypeAsync_GoogleLocation_ReturnsLocations() { // Arrange var apiRoute = $"https://maps.googleapis.com/maps/api/place/nearbysearch/json?location={coordinates}&radius=500&key={apiKey}"; var client = new HliHttpClient(apiRoute); // Act var result = await client.GetDataAsTypeAsync <GoogleLocation>(); // Assert Assert.IsTrue(result.results.Any()); }