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")); 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); }