Convert test data sources to typed TheoryData
Replace untyped MemberData sources with TheoryData<...>, use collection expressions for array and list literals, drop redundant casts and null suppressions, and give log-assertion helpers an IsEnabled setup so guarded log calls stay verifiable.
This commit is contained in:
@@ -227,7 +227,7 @@ public class LightMonitorInitTests
|
||||
{
|
||||
var sut = CreateSut();
|
||||
|
||||
var act = () => sut.InitializeAsync();
|
||||
var act = sut.InitializeAsync;
|
||||
|
||||
await act.Should().NotThrowAsync();
|
||||
}
|
||||
|
||||
@@ -151,12 +151,12 @@ internal static class LightMonitorTestData
|
||||
/// <summary>
|
||||
/// Person id configurations that resolve to "nobody tracked".
|
||||
/// </summary>
|
||||
public static TheoryData<string[]> NoPersonEntityIdSets { get; } = new()
|
||||
{
|
||||
{ [] },
|
||||
{ [string.Empty] },
|
||||
{ [" "] }
|
||||
};
|
||||
public static TheoryData<string[]> NoPersonEntityIdSets { get; } =
|
||||
[
|
||||
[],
|
||||
[string.Empty],
|
||||
[" "]
|
||||
];
|
||||
|
||||
private static TheoryData<string?[]> CreatePresenceStateMatrix()
|
||||
{
|
||||
|
||||
@@ -4,7 +4,6 @@ using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Moq;
|
||||
using NetDaemon.HassModel;
|
||||
using NetDaemon.HassModel.Entities;
|
||||
using LightMonitorManager;
|
||||
|
||||
namespace LightMonitor.Manager.Tests;
|
||||
|
||||
Reference in New Issue
Block a user