24729ee267
- Reindent appsettings.json and the MSBuild project files - Collapse single-statement guard blocks and tidy using and member order - Normalize XML doc indentation and file endings - Reorder BatteryMonitor test-data helpers and move the exclusion tests into their own region - Carry the same formatting through the boiler config, control, entity and test files
59 lines
1.6 KiB
C#
59 lines
1.6 KiB
C#
using BoilerMonitorManager.Models;
|
|
using FluentAssertions;
|
|
|
|
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);
|
|
|
|
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(false, false);
|
|
|
|
options.Enabled.Should().BeFalse();
|
|
options.CleanupEntitiesOnStartup.Should().BeFalse();
|
|
BoilerMonitorOptions.SectionName.Should().Be("BoilerMonitor");
|
|
}
|
|
} |