91287c9860
* Fix startup binding and prep v1.2.0 * Polish v1.2.0 validation UX * Fix final v1.2.0 validation polish * Make Activity Logs a ThreadPilot audit trail * Fix high scheduling registry value * Polish process list and automation settings UX * Fix process context menu separator styling * Theme process context menu visuals * Stabilize process context menu styling * Remove process menu icon gutter * Polish startup and idle process refresh * Finalize PR22 release polish
56 lines
1.7 KiB
C#
56 lines
1.7 KiB
C#
/*
|
|
* ThreadPilot - dependency injection registration tests.
|
|
*/
|
|
namespace ThreadPilot.Core.Tests
|
|
{
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using ThreadPilot.Models;
|
|
using ThreadPilot.Services;
|
|
|
|
public sealed class ServiceConfigurationTests
|
|
{
|
|
[Fact]
|
|
public void ConfigureApplicationServices_RegistersPersistentRuleAutoApplyService()
|
|
{
|
|
using var provider = CreateProvider();
|
|
|
|
var service = provider.GetRequiredService<IPersistentRuleAutoApplyService>();
|
|
|
|
Assert.IsType<PersistentRuleAutoApplyService>(service);
|
|
}
|
|
|
|
[Fact]
|
|
public void ConfigureApplicationServices_RegistersProcessRuleCreationService()
|
|
{
|
|
using var provider = CreateProvider();
|
|
|
|
var service = provider.GetRequiredService<IProcessRuleCreationService>();
|
|
|
|
Assert.IsType<ProcessRuleCreationService>(service);
|
|
}
|
|
|
|
[Fact]
|
|
public void ConfigureApplicationServices_RegistersActivityAuditService()
|
|
{
|
|
using var provider = CreateProvider();
|
|
|
|
var service = provider.GetRequiredService<IActivityAuditService>();
|
|
|
|
Assert.IsType<ActivityAuditService>(service);
|
|
}
|
|
|
|
[Fact]
|
|
public void ApplicationSettings_DefaultsToPersistentRulesAutoApplyEnabled()
|
|
{
|
|
var settings = new ApplicationSettingsModel();
|
|
|
|
Assert.True(settings.ApplyPersistentRulesOnProcessStart);
|
|
}
|
|
|
|
private static ServiceProvider CreateProvider() =>
|
|
new ServiceCollection()
|
|
.ConfigureApplicationServices()
|
|
.BuildServiceProvider(new ServiceProviderOptions { ValidateScopes = true });
|
|
}
|
|
}
|