wabbajack/Wabbajack.FileExtractor.Test/Startup.cs

32 lines
1.2 KiB
C#
Raw Normal View History

2021-09-27 12:42:46 +00:00
using System;
using System.Text.Json;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Wabbajack.Common;
using Wabbajack.DTOs;
using Wabbajack.Paths.IO;
using Wabbajack.RateLimiter;
using Xunit.DependencyInjection;
using Xunit.DependencyInjection.Logging;
namespace Wabbajack.FileExtractor.Test
{
public class Startup
{
public void ConfigureServices(IServiceCollection service)
{
service.AddSingleton<TemporaryFileManager, TemporaryFileManager>();
service.AddSingleton(new ParallelOptions {MaxDegreeOfParallelism = Environment.ProcessorCount});
service.AddAllSingleton<IResource, IResource<FileExtractor>, Resource<FileExtractor>>(s =>
2021-10-18 21:12:32 +00:00
new Resource<FileExtractor>("File Extractor", 2));
2021-09-27 12:42:46 +00:00
service.AddSingleton<FileExtractor>();
service.AddSingleton(new JsonSerializerOptions());
}
public void Configure(ILoggerFactory loggerFactory, ITestOutputHelperAccessor accessor)
{
loggerFactory.AddProvider(new XunitTestOutputLoggerProvider(accessor, delegate { return true; }));
}
}
}