public void When_Invoked_Should_RainDelay() { // Arrange var service = RachioService.Create(new TestServiceOptions()); // Act service.Person()?.Devices.First().RainDelay(1); // Assert }
public void When_Created_Should_Succeed() { var service = RachioService.Create(new ServiceOptions { AccessToken = "{Your Access Token}" }); var person = service.Person(); Assert.NotNull(service); Assert.NotNull(person); }
public void When_Invoked_Should_StopWater() { // Arrange var service = RachioService.Create(new TestServiceOptions()); // Act service.Person().Devices.First().StopWater(); // Assert }
public void When_Invoked_Should_Get_CurrentPerson() { // Arrange var service = RachioService.Create(new TestServiceOptions()); // Act var currentPerson = service.Person(); // Assert Assert.NotNull(currentPerson); Assert.True(!string.IsNullOrEmpty(currentPerson?.Id)); }
public void When_Invoked_Should_Get_Forecast() { // Arrange var service = RachioService.Create(new TestServiceOptions()); var device = service.Person().Devices.First(); // Act var forecast = device.Forecast(); // Assert Assert.NotNull(forecast); }
public void When_Invoked_Should_Get_ScheduleItems() { // Arrange var service = RachioService.Create(new TestServiceOptions()); var device = service.Person().Devices.First(); // Act var scheduleItems = device.ScheduleItems(); // Assert Assert.NotNull(scheduleItems); Assert.NotEmpty(scheduleItems); }
public void When_Invoked_Should_Get_Events() { // Arrange var service = RachioService.Create(new TestServiceOptions()); var device = service.Person().Devices.First(); // Act var today = DateTime.UtcNow; var events = device.Events(today.AddDays(-7), today); // Assert Assert.NotNull(events); Assert.NotEmpty(events); }
public void When_Invoked_Should_Get_Devices() { // Arrange var service = RachioService.Create(new TestServiceOptions()); // Act var devices = service.Person().Devices; // Assert foreach (var device in devices) { var deviceInfo = service.Device(device.Id); Assert.NotNull(deviceInfo); } }
public void When_Invoked_Should_Get_CurrentSchedule() { // Arrange var service = RachioService.Create(new TestServiceOptions()); var devices = service.Person().Devices; foreach (var device in devices) { // Act var currentSchedule = device.CurrentSchedule(); // Assert Assert.NotNull(currentSchedule); } }