public void NightRange_OUT_OF_RANGE_ShouldBeNotFulfilled() { var timer = new TestHomeAutomationTimer(); timer.CurrentTime = TimeSpan.Parse("15:00"); var condition = new TimeRangeCondition(timer) .WithStart(TimeSpan.Parse("18:00")) .WithEnd(TimeSpan.Parse("08:00")); condition.Validate().ShouldBeEquivalentTo(ConditionState.NotFulfilled); }
public void AndjustedRange_OUT_OF_RANGE_ShouldBeNotFulfilled() { var timer = new TestHomeAutomationTimer(); timer.CurrentTime = TimeSpan.Parse("15:00"); // 10-18 adjusted to 16-18 var condition = new TimeRangeCondition(timer) .WithStart(TimeSpan.Parse("10:00")) .WithEnd(TimeSpan.Parse("18:00")) .WithStartAdjustment(TimeSpan.FromHours(6)); condition.Validate().ShouldBeEquivalentTo(ConditionState.NotFulfilled); }