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,11 +1,11 @@
|
||||
using System.Text.Json;
|
||||
using BatteryMonitor.Models;
|
||||
using BatteryMonitorManager;
|
||||
using FluentAssertions;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Moq;
|
||||
using NetDaemon.HassModel;
|
||||
using NetDaemon.HassModel.Entities;
|
||||
using BatteryMonitor.Models;
|
||||
using BatteryMonitorManager;
|
||||
using static BatteryMonitor.Manager.Tests.BatteryMonitorTestData;
|
||||
|
||||
namespace BatteryMonitor.Manager.Tests;
|
||||
@@ -36,10 +36,10 @@ public class BatteryNotificationServiceTests
|
||||
public void NotifyLowBattery_WithDevices_ShouldCallPersistentNotificationCreate(int deviceCount)
|
||||
{
|
||||
var devices = CreateSensorInfos(
|
||||
[
|
||||
.. Enumerable.Range(0, deviceCount)
|
||||
.Select(i => ($"sensor.device_{i:D3}", $"Device {i:D3}", (double)(i % 5)))
|
||||
]);
|
||||
[
|
||||
.. Enumerable.Range(0, deviceCount)
|
||||
.Select(i => ($"sensor.device_{i:D3}", $"Device {i:D3}", (double)(i % 5)))
|
||||
]);
|
||||
|
||||
var sut = CreateSut();
|
||||
sut.NotifyLowBattery(devices);
|
||||
@@ -139,10 +139,7 @@ public class BatteryNotificationServiceTests
|
||||
{
|
||||
var sut = CreateSut();
|
||||
|
||||
for (var i = 0; i < calls; i++)
|
||||
{
|
||||
sut.DismissNotification();
|
||||
}
|
||||
for (var i = 0; i < calls; i++) sut.DismissNotification();
|
||||
|
||||
VerifyCallService(BatteryMonitorConsts.PersistentNotificationDismissService, Times.Exactly(calls));
|
||||
VerifyCallService(BatteryMonitorConsts.PersistentNotificationCreateService, Times.Never());
|
||||
@@ -222,7 +219,8 @@ public class BatteryNotificationServiceTests
|
||||
[InlineData("Full Battery", 100, "- **Full Battery**: 100%")]
|
||||
[InlineData("", 5, "- ****: 5%")]
|
||||
[InlineData(" ", 4, "- ** **: 4%")]
|
||||
public void BuildNotificationMessage_ShouldFormatDeviceLine(string friendlyName, double batteryLevel, string expectedLine)
|
||||
public void BuildNotificationMessage_ShouldFormatDeviceLine(string friendlyName, double batteryLevel,
|
||||
string expectedLine)
|
||||
{
|
||||
var devices = CreateSensorInfos(("sensor.a", friendlyName, batteryLevel));
|
||||
|
||||
@@ -279,4 +277,4 @@ public class BatteryNotificationServiceTests
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user