diff --git a/tests/Heimdall.Web.Tests/Components/Pages/AgentDetailLogsTests.cs b/tests/Heimdall.Web.Tests/Components/Pages/AgentDetailLogsTests.cs index 17a301a..66d5ac4 100644 --- a/tests/Heimdall.Web.Tests/Components/Pages/AgentDetailLogsTests.cs +++ b/tests/Heimdall.Web.Tests/Components/Pages/AgentDetailLogsTests.cs @@ -27,15 +27,15 @@ public class AgentDetailLogsTests : PageTestBase string level = "Warning", string? source = "AgentRegistrationService", string? exception = null) => new() - { - Id = Guid.NewGuid(), - AgentId = AgentId, - TimestampUtc = DateTime.UtcNow.AddMinutes(-5), - Level = level, - Message = message, - Source = source, - Exception = exception - }; + { + Id = Guid.NewGuid(), + AgentId = AgentId, + TimestampUtc = DateTime.UtcNow.AddMinutes(-5), + Level = level, + Message = message, + Source = source, + Exception = exception + }; private void HandlerLogs(PagedData data) => Handler.OnGet($"api/agents/{AgentId}/logs", data); diff --git a/tests/Heimdall.Web.Tests/Components/Pages/AuditLogsPageTests.cs b/tests/Heimdall.Web.Tests/Components/Pages/AuditLogsPageTests.cs index f8959d2..e7f7776 100644 --- a/tests/Heimdall.Web.Tests/Components/Pages/AuditLogsPageTests.cs +++ b/tests/Heimdall.Web.Tests/Components/Pages/AuditLogsPageTests.cs @@ -14,15 +14,15 @@ public class AuditLogsPageTests : PageTestBase string resourceType = "User", string? userEmail = "admin@heimdall.local", string? ip = "192.168.1.10") => new() - { - Id = Guid.NewGuid(), - UserEmail = userEmail, - Action = action, - ResourceType = resourceType, - ResourceId = Guid.NewGuid().ToString(), - IpAddress = ip, - Timestamp = DateTime.UtcNow.AddHours(-1) - }; + { + Id = Guid.NewGuid(), + UserEmail = userEmail, + Action = action, + ResourceType = resourceType, + ResourceId = Guid.NewGuid().ToString(), + IpAddress = ip, + Timestamp = DateTime.UtcNow.AddHours(-1) + }; [Fact] public void AuditLogsPage_AfficheLogs() diff --git a/tests/Heimdall.Web.Tests/Components/Pages/DiscoveriesPageTests.cs b/tests/Heimdall.Web.Tests/Components/Pages/DiscoveriesPageTests.cs index 04d00f4..a5e1c67 100644 --- a/tests/Heimdall.Web.Tests/Components/Pages/DiscoveriesPageTests.cs +++ b/tests/Heimdall.Web.Tests/Components/Pages/DiscoveriesPageTests.cs @@ -17,23 +17,23 @@ public class DiscoveriesPageTests : PageTestBase string? vendor = "Hikvision", string? hardware = "DS-2CD2T47", string[]? urls = null) => new() - { - Id = DiscoveryId, - SiteId = SiteId, - IpAddress = ip, - MacAddress = "3C:EF:8C:12:34:56", - Vendor = vendor, - OnvifHardware = hardware, - IsReachable = true, - DetectedType = "Standard", - DiscoveryMethod = "OnvifWsDiscovery", - OpenPorts = [80, 554, 3702], - OnvifDeviceServiceUrl = $"http://{ip}/onvif/device_service", - OnvifName = vendor, - OnvifPort = 3702, - ProbedAt = DateTime.UtcNow.AddMinutes(-2), - StreamUrls = urls ?? [$"rtsp://{ip}:554/stream1"], - }; + { + Id = DiscoveryId, + SiteId = SiteId, + IpAddress = ip, + MacAddress = "3C:EF:8C:12:34:56", + Vendor = vendor, + OnvifHardware = hardware, + IsReachable = true, + DetectedType = "Standard", + DiscoveryMethod = "OnvifWsDiscovery", + OpenPorts = [80, 554, 3702], + OnvifDeviceServiceUrl = $"http://{ip}/onvif/device_service", + OnvifName = vendor, + OnvifPort = 3702, + ProbedAt = DateTime.UtcNow.AddMinutes(-2), + StreamUrls = urls ?? [$"rtsp://{ip}:554/stream1"], + }; private static AgentItem Agent() => new() { diff --git a/tests/Heimdall.Web.Tests/Components/Pages/UsersPageTests.cs b/tests/Heimdall.Web.Tests/Components/Pages/UsersPageTests.cs index 5228d9e..b8c2e73 100644 --- a/tests/Heimdall.Web.Tests/Components/Pages/UsersPageTests.cs +++ b/tests/Heimdall.Web.Tests/Components/Pages/UsersPageTests.cs @@ -14,18 +14,18 @@ public class UsersPageTests : PageTestBase string email = "alice@heimdall.local", IList? roles = null, bool lockedOut = false) => new() - { - Id = Guid.NewGuid(), - Email = email, - DisplayName = name, - Theme = "Auto", - Language = "fr", - Roles = roles ?? ["Viewer"], - TwoFactorEnabled = false, - IsLockedOut = lockedOut, - EmailConfirmed = true, - CreatedAt = DateTime.UtcNow.AddDays(-10) - }; + { + Id = Guid.NewGuid(), + Email = email, + DisplayName = name, + Theme = "Auto", + Language = "fr", + Roles = roles ?? ["Viewer"], + TwoFactorEnabled = false, + IsLockedOut = lockedOut, + EmailConfirmed = true, + CreatedAt = DateTime.UtcNow.AddDays(-10) + }; [Fact] public void UsersPage_AfficheListeDesUtilisateurs() diff --git a/tests/Heimdall.Web.Tests/Filters/ExceptionFilterTests.cs b/tests/Heimdall.Web.Tests/Filters/ExceptionFilterTests.cs index 1584cd0..a01dce8 100644 --- a/tests/Heimdall.Web.Tests/Filters/ExceptionFilterTests.cs +++ b/tests/Heimdall.Web.Tests/Filters/ExceptionFilterTests.cs @@ -63,9 +63,9 @@ public class ExceptionFilterTests Assert.True(dict.ContainsKey("error")); var error = dict["error"]; - var errorType = error!.GetType(); - var errorDict = errorType.GetProperties() - .ToDictionary(p => p.Name, p => p.GetValue(error)); + var errorType = error!.GetType(); + var errorDict = errorType.GetProperties() + .ToDictionary(p => p.Name, p => p.GetValue(error)); Assert.Equal("InternalServerError", errorDict["code"]?.ToString()); Assert.Equal("An unexpected error occurred", errorDict["message"]?.ToString());