Files
HomeAssistant/BoilerMonitor.Manager.Tests/BoilerMonitorOptionsTests.cs
T
gitea_admin 5777e641f6 Add shared test data builders and Qodana configuration
- Extract per-monitor *TestData helper classes and rework tests to use them
- Add boiler run-time tracker abstraction (implementation pending)
- Drop unused NordPool init/update-result types and stale PLAN.md
- Add qodana.yaml with the inspection set to keep the analysis focused
2026-11-29 21:30:13 +02:00

60 lines
1.7 KiB
C#

using FluentAssertions;
using BoilerMonitorManager.Models;
namespace BoilerMonitor.Manager.Tests;
public class BoilerMonitorOptionsTests
{
[Fact]
public void Defaults_ShouldHaveEnabledTrue()
{
var options = new BoilerMonitorOptions();
options.Enabled.Should().BeTrue();
}
[Fact]
public void Defaults_ShouldHaveCleanupEntitiesOnStartupTrue()
{
var options = new BoilerMonitorOptions();
options.CleanupEntitiesOnStartup.Should().BeTrue();
}
[Fact]
public void SectionName_ShouldBeBoilerMonitor()
{
BoilerMonitorOptions.SectionName.Should().Be("BoilerMonitor");
}
[Theory]
[InlineData(false)]
[InlineData(true)]
public void Enabled_WhenSet_ShouldReturnConfiguredValue(bool enabled)
{
var options = BoilerMonitorTestData.CreateOptions(enabled: enabled);
options.Enabled.Should().Be(enabled);
}
[Theory]
[InlineData(false)]
[InlineData(true)]
public void CleanupEntitiesOnStartup_WhenSet_ShouldReturnConfiguredValue(bool cleanupEntitiesOnStartup)
{
var options = BoilerMonitorTestData.CreateOptions(cleanupEntitiesOnStartup: cleanupEntitiesOnStartup);
options.CleanupEntitiesOnStartup.Should().Be(cleanupEntitiesOnStartup);
}
[Fact]
public void Options_WhenBothFlagsDisabled_ShouldPreserveEachValueIndependently()
{
var options = BoilerMonitorTestData.CreateOptions(enabled: false, cleanupEntitiesOnStartup: false);
options.Enabled.Should().BeFalse();
options.CleanupEntitiesOnStartup.Should().BeFalse();
BoilerMonitorOptions.SectionName.Should().Be("BoilerMonitor");
}
}