Add input_boolean for water heater preparation logic
Refreshed logic to allow users to toggle hot water preparation. Introduced new `input_boolean.boiler_prepare_hot_water` and updated config, services, and tests to ensure water readiness only when required.
This commit is contained in:
@@ -161,6 +161,23 @@ public class CheapestIntervalsFinderTests
|
||||
result.Should().OnlyContain(r => r.Price <= 6.0);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void FindCheapestIntervals_WithMaxPriceCap_ShouldIncludeAllIntervalsBeforeDeadline()
|
||||
{
|
||||
// Arrange: prices 10, 3, 7, 1, 5, 15 - with cap 6.0 only 3 would qualify; with double.MaxValue all qualify
|
||||
var sut = CreateSut();
|
||||
var dayStart = new DateTime(2026, 2, 26, 0, 0, 0);
|
||||
var prices = CreatePricesWithValues(dayStart, 10.0, 3.0, 7.0, 1.0, 5.0, 15.0);
|
||||
var deadline = dayStart.AddDays(1);
|
||||
|
||||
// Act
|
||||
var result = sut.FindCheapestIntervals(prices, 4, double.MaxValue, deadline);
|
||||
|
||||
// Assert: all 6 intervals are eligible, we take 4 cheapest: 1, 3, 5, 7
|
||||
result.Should().HaveCount(4);
|
||||
result.Select(r => r.Price).OrderBy(p => p).Should().ContainInOrder(1.0, 3.0, 5.0, 7.0);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void FindCheapestIntervals_WithDeadlineAndPriceCap_ShouldApplyBothFilters()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user