public async Task MakeSureDeviceListGetsUpdatedWithDeviceDetailsTest() { await SenseApi.GetDeviceList(int.Parse(Config["monitor-ids"])); var deviceDetails = await SenseApi.GetDeviceDetails(int.Parse(Config["monitor-ids"]), SenseApi.DeviceList.First().Id); Assert.IsTrue(SenseApi.DeviceList.Find(x => x.Id == deviceDetails.Device.Id).LastState != null); }
public async Task GetDeviceDetails() { if (SenseApi.DeviceList == null || SenseApi.DeviceList.Count == 0) { await SenseApi.GetDeviceList(int.Parse(Config["monitor-ids"])); } var rnd = new Random(); var r = rnd.Next(SenseApi.DeviceList.Count); var result = await SenseApi.GetDeviceDetails(int.Parse(Config["monitor-ids"]), SenseApi.DeviceList[r].Id); Assert.IsTrue(result.Device.Id == SenseApi.DeviceList[r].Id); }