71 lines
1.7 KiB
C#
71 lines
1.7 KiB
C#
using FluentAssertions;
|
|
using PowerMonitorManager.Models;
|
|
using PowerMonitorManager.Models.Consts;
|
|
|
|
namespace PowerMonitor.Manager.Tests;
|
|
|
|
public class PowerMonitorOptionsTests
|
|
{
|
|
[Fact]
|
|
public void Defaults_ShouldHaveEnabledTrue()
|
|
{
|
|
var options = new PowerMonitorOptions();
|
|
|
|
options.Enabled.Should().BeTrue();
|
|
}
|
|
|
|
[Fact]
|
|
public void Defaults_ShouldHaveExpectedPollInterval()
|
|
{
|
|
var options = new PowerMonitorOptions();
|
|
|
|
options.PollIntervalSeconds.Should().Be(PowerMonitorConsts.DefaultPollIntervalSeconds);
|
|
}
|
|
|
|
[Fact]
|
|
public void Defaults_ShouldHaveExpectedSmoothingWindowSize()
|
|
{
|
|
var options = new PowerMonitorOptions();
|
|
|
|
options.SmoothingWindowSize.Should().Be(PowerMonitorConsts.DefaultSmoothingWindowSize);
|
|
}
|
|
|
|
[Fact]
|
|
public void Defaults_ShouldHaveExpectedAnomalyThreshold()
|
|
{
|
|
var options = new PowerMonitorOptions();
|
|
|
|
options.AnomalyThresholdWatts.Should().Be(PowerMonitorConsts.DefaultAnomalyThresholdWatts);
|
|
}
|
|
|
|
[Fact]
|
|
public void Defaults_ShouldHaveEmptyMainMeterEntityId()
|
|
{
|
|
var options = new PowerMonitorOptions();
|
|
|
|
options.MainMeterEntityId.Should().BeEmpty();
|
|
}
|
|
|
|
[Fact]
|
|
public void Defaults_ShouldHaveEmptyExcludedSensorPatterns()
|
|
{
|
|
var options = new PowerMonitorOptions();
|
|
|
|
options.ExcludedSensorPatterns.Should().BeEmpty();
|
|
}
|
|
|
|
[Fact]
|
|
public void SectionName_ShouldBePowerMonitor()
|
|
{
|
|
PowerMonitorOptions.SectionName.Should().Be("PowerMonitor");
|
|
}
|
|
|
|
[Fact]
|
|
public void Enabled_WhenSetToFalse_ShouldReturnFalse()
|
|
{
|
|
var options = new PowerMonitorOptions { Enabled = false };
|
|
|
|
options.Enabled.Should().BeFalse();
|
|
}
|
|
}
|