Ejemplo n.º 1
0
        private void Setup()
        {
            _controller = new TestController();
            _controller.SetTime(TimeSpan.Parse("12:00"));

            var testRollerShutterFactory = new TestRollerShutterFactory(_controller.TimerService, _controller.SchedulerService, new SettingsService(new BackupService(), new StorageService()));

            _weatherStation = new TestWeatherStation();
            _weatherStation.OutdoorTemperature = 20;

            _rollerShutter = testRollerShutterFactory.CreateTestRollerShutter();
            _controller.ComponentService.AddComponent(_rollerShutter);

            _automation = new RollerShutterAutomation(
                AutomationIdGenerator.EmptyId,
                _controller.NotificationService,
                _controller.SchedulerService,
                _controller.DateTimeService,
                _controller.DaylightService,
                _weatherStation,
                _controller.ComponentService,
                new SettingsService(new BackupService(), new StorageService()), new ResourceService(new BackupService(), new StorageService(), new SettingsService(new BackupService(), new StorageService())));

            _automation.WithRollerShutters(_rollerShutter);
        }
Ejemplo n.º 2
0
        private void Setup()
        {
            _controller = new TestController();
            _controller.SetTime(TimeSpan.Parse("12:00"));

            var testRollerShutterFactory = new TestRollerShutterFactory(_controller.Timer);

            _weatherStation = new TestWeatherStation();
            _weatherStation.SetTemperature(20);
            _daylightService = new TestDaylightService();

            _rollerShutter = testRollerShutterFactory.CreateTestRollerShutter();
            _controller.ServiceLocator.RegisterService(typeof(TestWeatherStation), _weatherStation);
            _controller.AddComponent(_rollerShutter);

            _automation = new RollerShutterAutomation(
                AutomationIdFactory.EmptyId,
                _controller.ServiceLocator.GetService <ISchedulerService>(),
                _controller.ServiceLocator.GetService <IDateTimeService>(),
                _daylightService,
                _weatherStation,
                _controller);

            _automation.WithRollerShutters(_rollerShutter);
        }
        private void Setup()
        {
            _controller = new TestController();
            _controller.SetTime(TimeSpan.Parse("12:00"));

            _weatherStation = new TestWeatherStation {
                OutdoorTemperature = 20
            };

            _rollerShutter = new RollerShutter("Test", new TestRollerShutterAdapter(), _controller.GetInstance <ITimerService>(), _controller.GetInstance <ISettingsService>());
            _controller.GetInstance <IComponentRegistryService>().RegisterComponent(_rollerShutter);

            _automation = new RollerShutterAutomation(
                "Test",
                _controller.GetInstance <INotificationService>(),
                _controller.GetInstance <ISchedulerService>(),
                _controller.GetInstance <IDateTimeService>(),
                _controller.GetInstance <IDaylightService>(),
                _weatherStation,
                _controller.GetInstance <IComponentRegistryService>(),
                _controller.GetInstance <ISettingsService>(),
                _controller.GetInstance <IResourceService>());

            _automation.WithRollerShutters(_rollerShutter);
        }
Ejemplo n.º 4
0
        private void Setup()
        {
            _controller = new TestController();
            _controller.SetTime(TimeSpan.Parse("12:00"));
            _weatherStation = new TestWeatherStation(new DeviceId("Test.WeatherStation"), _controller.Timer, _controller.Logger);

            _rollerShutter = new TestRollerShutter(new ActuatorId("Test.RollerShutter"), _controller.Logger);
            _controller.AddDevice(_weatherStation);
            _controller.AddActuator(_rollerShutter);

            _automation = new RollerShutterAutomation(AutomationIdFactory.EmptyId, _controller.Timer,
                                                      _weatherStation, _controller.HttpApiController, _controller, _controller.Logger);

            _automation.WithRollerShutters(_rollerShutter);
        }
        private void Setup()
        {
            _controller = new TestController();
            _controller.SetTime(TimeSpan.Parse("12:00"));

            var testRollerShutterFactory = new TestRollerShutterFactory(_controller.Timer);

            _weatherStation = new TestWeatherStation(new DeviceId("Test.WeatherStation"), _controller.Timer);
            _weatherStation.SetTemperature(20);
            _daylightService = new TestDaylightService();

            _rollerShutter = testRollerShutterFactory.CreateTestRollerShutter();
            _controller.RegisterService(_weatherStation);
            _controller.AddComponent(_rollerShutter);

            _automation = new RollerShutterAutomation(
                AutomationIdFactory.EmptyId,
                _controller.Timer,
                _daylightService,
                _weatherStation,
                _controller);

            _automation.WithRollerShutters(_rollerShutter);
        }