Fix downloader tests

This commit is contained in:
Timothy Baldridge 2022-06-07 21:51:39 -06:00
parent b29bed24da
commit 790f7cd7aa

View File

@ -1,5 +1,6 @@
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Wabbajack.DTOs.Interventions;
using Wabbajack.Services.OSIntegrated; using Wabbajack.Services.OSIntegrated;
using Xunit.DependencyInjection; using Xunit.DependencyInjection;
using Xunit.DependencyInjection.Logging; using Xunit.DependencyInjection.Logging;
@ -11,10 +12,19 @@ public class Startup
public void ConfigureServices(IServiceCollection service) public void ConfigureServices(IServiceCollection service)
{ {
service.AddOSIntegrated(); service.AddOSIntegrated();
service.AddSingleton<IUserInterventionHandler, CancellingInterventionHandler>();
} }
public void Configure(ILoggerFactory loggerFactory, ITestOutputHelperAccessor accessor) public void Configure(ILoggerFactory loggerFactory, ITestOutputHelperAccessor accessor)
{ {
loggerFactory.AddProvider(new XunitTestOutputLoggerProvider(accessor, delegate { return true; })); loggerFactory.AddProvider(new XunitTestOutputLoggerProvider(accessor, delegate { return true; }));
} }
private class CancellingInterventionHandler : IUserInterventionHandler
{
public void Raise(IUserIntervention intervention)
{
intervention.Cancel();
}
}
} }