Apply code formatting cleanup across monitor projects
- 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
This commit is contained in:
@@ -1,21 +1,21 @@
|
||||
using FluentAssertions;
|
||||
using LeakMonitor.Models;
|
||||
using LeakMonitorManager;
|
||||
using LeakMonitorManager.Interface;
|
||||
using LeakMonitorManager.Models;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Moq;
|
||||
using NetDaemon.HassModel;
|
||||
using NetDaemon.HassModel.Entities;
|
||||
using LeakMonitor.Models;
|
||||
using LeakMonitorManager;
|
||||
using LeakMonitorManager.Interface;
|
||||
using LeakMonitorManager.Models;
|
||||
|
||||
namespace LeakMonitor.Manager.Tests;
|
||||
|
||||
public class LeakMonitorInitTests
|
||||
{
|
||||
private readonly Mock<IHaContext> _haContextMock = new();
|
||||
private readonly Mock<ILeakNotificationService> _notificationServiceMock = new();
|
||||
private readonly Mock<ILogger<LeakMonitorInit>> _loggerMock = new();
|
||||
private readonly Mock<ILeakNotificationService> _notificationServiceMock = new();
|
||||
private readonly LeakMonitorTestData.TrackingObservable<StateChange> _stateChanges = new();
|
||||
|
||||
public LeakMonitorInitTests()
|
||||
@@ -145,7 +145,7 @@ public class LeakMonitorInitTests
|
||||
[Fact]
|
||||
public void InitializeAsync_WhenNoSensorsConfigured_ShouldNotSubscribeAndLogWarning()
|
||||
{
|
||||
var sut = CreateSut(LeakMonitorTestData.CreateOptions(sensorEntityIds: []));
|
||||
var sut = CreateSut(LeakMonitorTestData.CreateOptions([]));
|
||||
|
||||
sut.Should().NotBeNull();
|
||||
_stateChanges.SubscriptionCount.Should().Be(0);
|
||||
@@ -169,7 +169,7 @@ public class LeakMonitorInitTests
|
||||
[MemberData(nameof(LeakMonitorTestData.BlankSensorIds), MemberType = typeof(LeakMonitorTestData))]
|
||||
public void InitializeAsync_WithBlankSensorId_ShouldStillSubscribeAndForward(string sensorEntityId)
|
||||
{
|
||||
CreateSut(LeakMonitorTestData.CreateOptions(sensorEntityIds: [sensorEntityId]));
|
||||
CreateSut(LeakMonitorTestData.CreateOptions([sensorEntityId]));
|
||||
|
||||
_stateChanges.SubscriptionCount.Should().Be(1);
|
||||
|
||||
@@ -186,7 +186,7 @@ public class LeakMonitorInitTests
|
||||
public void InitializeAsync_WithNullSensorEntry_ShouldStillSubscribeRemainingSensors()
|
||||
{
|
||||
CreateSut(LeakMonitorTestData.CreateOptions(
|
||||
sensorEntityIds: [null!, LeakMonitorTestData.BoilerSensorId]));
|
||||
[null!, LeakMonitorTestData.BoilerSensorId]));
|
||||
|
||||
_stateChanges.SubscriptionCount.Should().Be(2);
|
||||
|
||||
@@ -294,9 +294,7 @@ public class LeakMonitorInitTests
|
||||
_haContextMock.Object,
|
||||
LeakMonitorTestData.AquariumSensorId,
|
||||
LeakMonitorTestData.DetectionSequence))
|
||||
{
|
||||
_stateChanges.Publish(change);
|
||||
}
|
||||
|
||||
_notificationServiceMock.Verify(
|
||||
n => n.SendLeakAlert(LeakMonitorTestData.AquariumSensorId),
|
||||
@@ -352,4 +350,4 @@ public class LeakMonitorInitTests
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user