public async Task <Stats> GetPhotoStatsAsync(string id) { var uri = new GetPhotoStatsRequest(id).Uri; HttpResponseMessage response = await netClient.GetAsync(uri).ConfigureAwait(false); return(await ParseResponseAsync <Stats>(response).ConfigureAwait(false)); }
public async Task <Stats> GetPhotoStatsAsync(GetPhotoStatsRequest request) { var uri = request == null?Request.GetDefaultRequest <GetPhotoStatsRequest>().Uri : request.Uri; HttpResponseMessage response = await netClient.GetAsync(uri).ConfigureAwait(false); return(await ParseResponseAsync <Stats>(response).ConfigureAwait(false)); }
public void GetPhotoStatsRequest_Arguments_ProducesAnExpectedURI() { var id = "123"; var resolution = StatsResolution.DAYS; uint quantity = 5; var request = new GetPhotoStatsRequest(id, resolution, quantity); Assert.Matches($"/{id}", request.Uri.AbsoluteUri); Assert.Matches($"&resolution={resolution.Describe()}" + $"&quantity={quantity}", request.Uri.AbsoluteUri); }