diff options
| author | Bond-009 <bond.009@outlook.com> | 2023-01-13 11:51:36 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-13 11:51:36 +0100 |
| commit | 12786db0ccde25e9277556bc3d2885c57e9167ba (patch) | |
| tree | 03c8c8f1b527c82cef66c23bed918bf94478a385 /tests | |
| parent | 0571d3e403906167ce4204e63f8697f97e35d0bf (diff) | |
| parent | 033ffa9a8899be7f28e72603cf5881c066b40cd5 (diff) | |
Merge pull request #9078 from barronpm/migrate-to-ihost
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/Jellyfin.Server.Integration.Tests/JellyfinApplicationFactory.cs | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/tests/Jellyfin.Server.Integration.Tests/JellyfinApplicationFactory.cs b/tests/Jellyfin.Server.Integration.Tests/JellyfinApplicationFactory.cs index c38faeda1..1bfa5996d 100644 --- a/tests/Jellyfin.Server.Integration.Tests/JellyfinApplicationFactory.cs +++ b/tests/Jellyfin.Server.Integration.Tests/JellyfinApplicationFactory.cs @@ -8,6 +8,7 @@ using MediaBrowser.Common; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc.Testing; using Microsoft.AspNetCore.TestHost; +using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Serilog; @@ -78,11 +79,17 @@ namespace Jellyfin.Server.Integration.Tests commandLineOpts, startupConfig); _disposableComponents.Add(appHost); - var serviceCollection = new ServiceCollection(); - appHost.Init(serviceCollection); - // Configure the web host builder - Program.ConfigureWebHostBuilder(builder, appHost, serviceCollection, commandLineOpts, startupConfig, appPaths); + builder.ConfigureServices(services => appHost.Init(services)) + .ConfigureWebHostBuilder(appHost, startupConfig, appPaths) + .ConfigureAppConfiguration((context, builder) => + { + builder + .SetBasePath(appPaths.ConfigurationDirectoryPath) + .AddInMemoryCollection(ConfigurationOptions.DefaultConfiguration) + .AddEnvironmentVariables("JELLYFIN_") + .AddInMemoryCollection(commandLineOpts.ConvertToConfig()); + }); } /// <inheritdoc/> |
