aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2023-11-12 16:23:11 +0100
committerGitHub <noreply@github.com>2023-11-12 16:23:11 +0100
commitfc694289a9ff5fd668a461cbdb665eb492dc504f (patch)
tree934c4c0e2ad70ec8e872a1dc05a8aeb33ca6dce0 /tests
parent4288106acdcd36d6d18c9f1be884f791e4e5170b (diff)
parentb0120d5d4ce787c2a44f2d172d0760b545804e0f (diff)
Merge pull request #10557 from barronpm/dlna-plugin
Move DLNA to Plugin (Part 1)
Diffstat (limited to 'tests')
-rw-r--r--tests/Jellyfin.Server.Integration.Tests/JellyfinApplicationFactory.cs21
1 files changed, 10 insertions, 11 deletions
diff --git a/tests/Jellyfin.Server.Integration.Tests/JellyfinApplicationFactory.cs b/tests/Jellyfin.Server.Integration.Tests/JellyfinApplicationFactory.cs
index 1c87d11f1..a078eff77 100644
--- a/tests/Jellyfin.Server.Integration.Tests/JellyfinApplicationFactory.cs
+++ b/tests/Jellyfin.Server.Integration.Tests/JellyfinApplicationFactory.cs
@@ -8,9 +8,9 @@ using Jellyfin.Server.Helpers;
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.Hosting;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Serilog;
@@ -39,9 +39,9 @@ namespace Jellyfin.Server.Integration.Tests
}
/// <inheritdoc/>
- protected override IWebHostBuilder CreateWebHostBuilder()
+ protected override IHostBuilder CreateHostBuilder()
{
- return new WebHostBuilder();
+ return new HostBuilder();
}
/// <inheritdoc/>
@@ -95,18 +95,17 @@ namespace Jellyfin.Server.Integration.Tests
}
/// <inheritdoc/>
- protected override TestServer CreateServer(IWebHostBuilder builder)
+ protected override IHost CreateHost(IHostBuilder builder)
{
- // Create the test server using the base implementation
- var testServer = base.CreateServer(builder);
-
- // Finish initializing the app host
- var appHost = (TestAppHost)testServer.Services.GetRequiredService<IApplicationHost>();
- appHost.ServiceProvider = testServer.Services;
+ var host = builder.Build();
+ var appHost = (TestAppHost)host.Services.GetRequiredService<IApplicationHost>();
+ appHost.ServiceProvider = host.Services;
appHost.InitializeServices().GetAwaiter().GetResult();
+ host.Start();
+
appHost.RunStartupTasksAsync().GetAwaiter().GetResult();
- return testServer;
+ return host;
}
/// <inheritdoc/>