refactor(toolbox): drop unused IProcessRunner from ApplyService ctor
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -39,7 +39,6 @@ public static class MauiProgram
|
||||
var appsDir = Path.Combine(AppContext.BaseDirectory, "apps");
|
||||
builder.Services.AddSingleton<IAppInstaller>(sp => new AppInstaller(sp.GetRequiredService<IProcessRunner>(), appsDir));
|
||||
builder.Services.AddSingleton<IApplyService>(sp => new ApplyService(
|
||||
sp.GetRequiredService<IProcessRunner>(),
|
||||
sp.GetRequiredService<IBitLockerService>(),
|
||||
sp.GetRequiredService<IAppInstaller>()));
|
||||
builder.Services.AddScoped<WizardState>();
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace SilverOS.Welcome.Core.Apply;
|
||||
// Toolbox Apply pipeline: apps -> bitlocker -> done.
|
||||
// Account creation moved to Windows Setup (WinPE collector); OS hardening runs from
|
||||
// SetupComplete; sm-bootstrap teardown is owned by Setup, not the toolbox.
|
||||
public sealed class ApplyService(IProcessRunner runner, IBitLockerService bitlocker, IAppInstaller installer) : IApplyService
|
||||
public sealed class ApplyService(IBitLockerService bitlocker, IAppInstaller installer) : IApplyService
|
||||
{
|
||||
public async Task RunAsync(ApplyRequest req, IProgress<ApplyProgress> progress, CancellationToken ct = default)
|
||||
{
|
||||
|
||||
@@ -33,7 +33,7 @@ public class ApplyServiceTests
|
||||
It.IsAny<IProgress<ApplyProgress>>(), It.IsAny<CancellationToken>()))
|
||||
.Callback(() => order.Add("apps")).ReturnsAsync(Array.Empty<AppInstallResult>());
|
||||
|
||||
var sut = new ApplyService(run.Object, bl.Object, installer.Object);
|
||||
var sut = new ApplyService(bl.Object, installer.Object);
|
||||
var req = new ApplyRequest(Flavour(), "123456", System.Array.Empty<AppCatalogEntry>());
|
||||
var progress = new List<string>();
|
||||
|
||||
@@ -59,7 +59,7 @@ public class ApplyServiceTests
|
||||
It.IsAny<IProgress<ApplyProgress>>(), It.IsAny<CancellationToken>()))
|
||||
.Callback(() => order.Add("apps")).ReturnsAsync(Array.Empty<AppInstallResult>());
|
||||
|
||||
var sut = new ApplyService(run.Object, bl.Object, installer.Object);
|
||||
var sut = new ApplyService(bl.Object, installer.Object);
|
||||
var req = new ApplyRequest(Flavour(), "", System.Array.Empty<AppCatalogEntry>());
|
||||
|
||||
await sut.RunAsync(req, new Progress<ApplyProgress>(_ => { }));
|
||||
@@ -78,7 +78,7 @@ public class ApplyServiceTests
|
||||
var installer = NoApps();
|
||||
var apps = new[] { new AppCatalogEntry { Id = "firefox", Name = "Firefox" } };
|
||||
|
||||
var sut = new ApplyService(run.Object, bl.Object, installer.Object);
|
||||
var sut = new ApplyService(bl.Object, installer.Object);
|
||||
var req = new ApplyRequest(Flavour(), "123456", apps);
|
||||
|
||||
await sut.RunAsync(req, new Progress<ApplyProgress>(_ => { }));
|
||||
|
||||
Reference in New Issue
Block a user