public async Task GetDistanceUnitGeneratesCorrectRequest() { const string expectedResult = "METRIC"; string fullNamePath = $"/v2/devices/{DeviceId}/settings/System.distanceUnits"; var runHandler = false; var httpClient = new HttpClient(new ActionMessageHandler(req => { runHandler = true; Assert.Equal(req.RequestUri.PathAndQuery, fullNamePath); return(new HttpResponseMessage(System.Net.HttpStatusCode.OK) { Content = new StringContent(Utility.GetExampleJson("Distance.json")) }); })) { BaseAddress = new Uri("https://testclient.com", UriKind.Absolute) }; var client = new SettingsClient(httpClient, DeviceId); var nameResult = await client.DistanceUnit(); Assert.True(runHandler); Assert.Equal(expectedResult, nameResult); }