Beispiel #1
0
        public void RollerShutter_Reset()
        {
            var testController = new TestController();
            var adapter        = new TestRollerShutterAdapter();
            var rollerShutter  = new RollerShutter("Test", adapter, testController.GetInstance <ITimerService>(), testController.GetInstance <ISettingsService>());

            rollerShutter.TryReset();
            Assert.AreEqual(1, adapter.StartMoveUpCalledCount);
            Assert.IsTrue(rollerShutter.GetState().Has(PowerState.On));
            Assert.IsTrue(rollerShutter.GetState().Has(VerticalMovingState.MovingUp));
        }
        public void SkipOpen_BecauseTooCold()
        {
            Setup();

            _weatherStation.OutdoorTemperature = 1.5F;
            _automation.WithDoNotOpenIfOutsideTemperatureIsBelowThan(2);
            _automation.PerformPendingActions();
            _rollerShutter.GetState().Has(PowerState.Off);

            Setup();

            _weatherStation.OutdoorTemperature = 2.5F;
            _automation.WithDoNotOpenIfOutsideTemperatureIsBelowThan(2);
            _automation.PerformPendingActions();
            _rollerShutter.GetState().Has(VerticalMovingState.MovingUp);
            _rollerShutter.GetState().Has(PowerState.Off);
        }
Beispiel #3
0
        public void SkipOpen_BecauseTooCold()
        {
            Setup();

            _weatherStation.Temperature = 1.5F;
            _automation.Settings.SkipIfFrozenIsEnabled   = true;
            _automation.Settings.SkipIfFrozenTemperature = 2;
            _automation.PerformPendingActions();
            _rollerShutter.GetState().Has(PowerState.Off);

            Setup();

            _weatherStation.Temperature = 2.5F;
            _automation.Settings.SkipIfFrozenIsEnabled   = true;
            _automation.Settings.SkipIfFrozenTemperature = 2;
            _automation.PerformPendingActions();
            _rollerShutter.GetState().Has(VerticalMovingState.MovingUp);
            _rollerShutter.GetState().Has(PowerState.Off);
        }