示例#1
0
    public void When_Invoked_Should_RainDelay()
    {
        // Arrange
        var service = RachioService.Create(new TestServiceOptions());

        // Act
        service.Person()?.Devices.First().RainDelay(1);

        // Assert
    }
示例#2
0
        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);
        }
示例#3
0
        public void When_Invoked_Should_StopWater()
        {
            // Arrange
            var service = RachioService.Create(new TestServiceOptions());

            // Act
            service.Person().Devices.First().StopWater();

            // Assert
        }
示例#4
0
    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));
    }
示例#5
0
        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);
        }
示例#6
0
        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);
        }
示例#7
0
        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);
        }
示例#8
0
        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);
            }
        }
示例#9
0
        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);
            }
        }