- Docker: remove default passwords from prod compose (required env vars) - CSRF: validate antiforgery tokens on /_auth/signin and /_auth/signout - EventsHub: broadcast to site-scoped Group() instead of Clients.All - SettingsController: redact secret values in logs - Create SetAgentSettingValidator + UpdateAppSettingValidator classes - Replace 3 placeholder test projects with meaningful tests - Remove FluentValidation auto-validation (incompatible with .NET 10)
39 lines
974 B
C#
39 lines
974 B
C#
using Hangfire;
|
|
using Hangfire.MemoryStorage;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
namespace Heimdall.Workers.Tests;
|
|
|
|
public class HangfireConfigurationTests
|
|
{
|
|
[Fact]
|
|
public void AddHangfire_WithMemoryStorage_RegistersJobStorage()
|
|
{
|
|
var services = new ServiceCollection();
|
|
services.AddHangfire(config =>
|
|
{
|
|
config.UseMemoryStorage();
|
|
});
|
|
|
|
var provider = services.BuildServiceProvider();
|
|
var storage = provider.GetService<JobStorage>();
|
|
|
|
Assert.NotNull(storage);
|
|
}
|
|
|
|
[Fact]
|
|
public void AddHangfire_WithMemoryStorage_StorageIsMemoryStorage()
|
|
{
|
|
var services = new ServiceCollection();
|
|
services.AddHangfire(config =>
|
|
{
|
|
config.UseMemoryStorage();
|
|
});
|
|
|
|
var provider = services.BuildServiceProvider();
|
|
var storage = provider.GetRequiredService<JobStorage>();
|
|
|
|
Assert.IsType<MemoryStorage>(storage);
|
|
}
|
|
}
|