using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Wabbajack.DTOs; using Wabbajack.Paths.IO; using Wabbajack.RateLimiter; using Wabbajack.VFS.Interfaces; using Xunit.DependencyInjection; using Xunit.DependencyInjection.Logging; namespace Wabbajack.VFS.Test; public class Startup { public void ConfigureServices(IServiceCollection service) { service.AddSingleton(); service .AddAllSingleton, Resource>( s => new Resource("File Extractor", 2)); service .AddAllSingleton, Resource>( s => new ("VFS Context", 2)); service .AddAllSingleton, Resource>( s => new ("File Hash Cache", 2)); // Keep this fixed at 2 so that we can detect deadlocks in the VFS parallelOptions service.AddSingleton(new ParallelOptions {MaxDegreeOfParallelism = 2}); service.AddSingleton(new FileHashCache(KnownFolders.EntryPoint.Combine("hashcache.sqlite"), new Resource("File Hashing", 10))); service.AddAllSingleton(x => new VFSDiskCache(KnownFolders.EntryPoint.Combine("vfscache.sqlite"))); service.AddTransient(); service.AddSingleton(); } public void Configure(ILoggerFactory loggerFactory, ITestOutputHelperAccessor accessor) { loggerFactory.AddProvider(new XunitTestOutputLoggerProvider(accessor, delegate { return true; })); } }