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:
@@ -15,8 +15,8 @@ public class ExhaustFanControlServiceTests
|
||||
private const string FanEntityId = "switch.exhaust_fan";
|
||||
|
||||
private readonly ShowerMonitorOptions _defaultOptions = ShowerMonitorTestData.CreateOptions();
|
||||
private readonly FakeTimeProvider _timeProvider = ShowerMonitorTestData.CreateTimeProvider();
|
||||
private readonly Mock<IHaContext> _haContextMock = new();
|
||||
private readonly FakeTimeProvider _timeProvider = ShowerMonitorTestData.CreateTimeProvider();
|
||||
|
||||
private DateTimeOffset Now => _timeProvider.GetUtcNow();
|
||||
|
||||
@@ -237,7 +237,7 @@ public class ExhaustFanControlServiceTests
|
||||
[InlineData(null)]
|
||||
public void Evaluate_WithConfiguredFanEntityId_TargetsThatExactEntity(string? entityId)
|
||||
{
|
||||
var service = CreateService(ShowerMonitorTestData.CreateOptions(exhaustFanEntityId: entityId!));
|
||||
var service = CreateService(ShowerMonitorTestData.CreateOptions(entityId!));
|
||||
|
||||
service.Evaluate(ShowerState.Active, Now);
|
||||
|
||||
@@ -264,17 +264,17 @@ public class ExhaustFanControlServiceTests
|
||||
{
|
||||
var targets = _haContextMock.Invocations
|
||||
.Where(invocation => invocation.Method.Name == nameof(IHaContext.CallService)
|
||||
&& (string?)invocation.Arguments[0] == "switch"
|
||||
&& (string?)invocation.Arguments[1] == service)
|
||||
&& (string?)invocation.Arguments[0] == "switch"
|
||||
&& (string?)invocation.Arguments[1] == service)
|
||||
.Select(invocation => (ServiceTarget?)invocation.Arguments[2])
|
||||
.ToList();
|
||||
|
||||
targets.Should().HaveCount(expectedCount, because);
|
||||
targets.Should().OnlyContain(
|
||||
target => target != null
|
||||
&& target.EntityIds != null
|
||||
&& target.EntityIds.Count == 1
|
||||
&& target.EntityIds.Single() == expectedEntityId,
|
||||
&& target.EntityIds != null
|
||||
&& target.EntityIds.Count == 1
|
||||
&& target.EntityIds.Single() == expectedEntityId,
|
||||
because);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user