public void Should_NotTurnOn_IfMotionDetected_AndTimeRangeConditionIs_NotFulfilled()
{
var timer = new TestTimerService();
var dateTimeService = new TestDateTimeService();
dateTimeService.SetTime(TimeSpan.Parse("18:00:00"));
var motionDetectorFactory = new TestMotionDetectorFactory(new SchedulerService(timer, dateTimeService), new SettingsService(new BackupService(), new StorageService()));
var stateMachineFactory = new TestStateMachineFactory();
var automation = new TurnOnAndOffAutomation(AutomationIdGenerator.EmptyId, dateTimeService, new SchedulerService(timer, dateTimeService), new SettingsService(new BackupService(), new StorageService()), new TestDaylightService());
var motionDetector = motionDetectorFactory.CreateTestMotionDetector();
var output = stateMachineFactory.CreateTestStateMachineWithOnOffStates();
output.GetState().ShouldBeEquivalentTo(BinaryStateId.Off);
automation.WithTurnOnWithinTimeRange(() => TimeSpan.Parse("10:00:00"), () => TimeSpan.Parse("15:00:00"));
automation.WithTrigger(motionDetector);
automation.WithTarget(output);
motionDetector.TriggerMotionDetection();
output.GetState().ShouldBeEquivalentTo(BinaryStateId.Off);
}