public async Task GetAllSensorsTest() { IHueRequest request = new GetAllSensorsRequest(); var response = await _client.GetResponseAsync(request); Assert.True(response is GetAllSensorsResponse); OnLog(response); }
private Task DeleteTmpSensorAsync() { OnLog("Teardown: deleteing temporary sensors"); IHueRequest request = new GetAllSensorsRequest(); return(_client.GetResponseAsync(request).ContinueWith(getAllSensors => { var tempSensors = ((GetAllSensorsResponse)getAllSensors.Result).Where(p => p.ModelId == "TMPSENSOR") .ToList(); Task.WhenAll(tempSensors.Select(p => _client.GetResponseAsync(new DeleteSensorRequest(p.Id)).ContinueWith(deleteResponse => { var deleteResponseResult = deleteResponse.Result; Assert.True(deleteResponseResult is SuccessResponse); OnLog(deleteResponseResult); }))).Wait(); })); }
public async Task <List <SensorRegistryRecord> > Handle( GetAllSensorsRequest request, CancellationToken token) { return(await registryCache.GetAllRecords()); }