public async Task GetUsageTrendDataForA1HourInterval() { var result = await SenseApi.GetUsageTrendData(int.Parse(Config["monitor-ids"]), Granularity.Hour, DateTime.Now.AddDays(-1)); Assert.IsTrue(result.Steps == 60); Assert.IsTrue(result.Scale == "hour"); }
public async Task GetMonitorHistoryInDays() { const int sampleCount = 365; var result = await SenseApi.GetMonitorHistory(int.Parse(Config["monitor-ids"]), Granularity.Day, DateTime.Now.AddDays(-365), sampleCount); Assert.IsTrue(result.Totals.Count == sampleCount); }
public async Task GetTimelineData() { var result = await SenseApi.GetTimelineData(int.Parse(Config["user-id"])); Assert.IsTrue(result.UserId == int.Parse(Config["user-id"])); Assert.IsTrue(result.Items.Count > 0); }
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 GetOtherDetails() { if (SenseApi.DeviceList == null || SenseApi.DeviceList.Count == 0) { await SenseApi.GetDeviceList(int.Parse(Config["monitor-ids"])); } var result = await SenseApi.GetOtherDetails(int.Parse(Config["monitor-ids"])); Assert.IsTrue(result.Device.Id.Contains("unknown", StringComparison.InvariantCultureIgnoreCase)); }
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); }
public async Task GetDeviceHistoryInHours() { const int sampleCount = 720; 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.GetDeviceHistory(int.Parse(Config["monitor-ids"]), SenseApi.DeviceList[r].Id, Granularity.Hour, DateTime.Now.AddDays(-30), sampleCount); Assert.IsTrue(result.Totals.Count == sampleCount); }
public async Task CheckMonitorStatus() { var result = await SenseApi.GetMonitorStatus(int.Parse(Config["monitor-ids"])); Assert.IsTrue(result.MonitorInfo.Serial != null); }
public async Task UnsuccessfulAuthenticationTest() { await SenseApi.Authenticate("*****@*****.**", "WhatIsGoingOn"); }
public async Task GetDeviceListTest() { var result = await SenseApi.GetDeviceList(int.Parse(Config["monitor-ids"])); Assert.IsTrue(result.Count > 0); }