diff --git a/src/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs b/src/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs index 7aea7f37a5..414ad6ec43 100644 --- a/src/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs +++ b/src/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs @@ -86,6 +86,7 @@ namespace Umbraco.Tests.Integration.Testing // Ensure CoreRuntime stopped (now it's a HostedService) IHost host = Services.GetRequiredService(); host.StopAsync().GetAwaiter().GetResult(); + host.Dispose(); } [TearDown] diff --git a/src/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeServiceVariantsTests.cs b/src/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeServiceVariantsTests.cs index 1fbfb00a1b..995e4d60ae 100644 --- a/src/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeServiceVariantsTests.cs +++ b/src/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeServiceVariantsTests.cs @@ -45,15 +45,6 @@ namespace Umbraco.Tests.Integration.Umbraco.Infrastructure.Services eventBinder.Start(); } - public override void TearDown() - { - // Ensure this is dipsosed - // TODO: How come MSDI doesn't automatically dispose all of these at the end of each test? - // How can we automatically dispose of all IDisposables at the end of the tests as if it were an aspnet app? - Services.GetRequiredService().Dispose(); - base.TearDown(); - } - private void AssertJsonStartsWith(int id, string expected) { var json = GetJson(id).Replace('"', '\'');