Merge pull request #9585 from rustybox/netcore/task/front-end-routing
Netcore: Dispose host on test teardown.
This commit is contained in:
@@ -86,6 +86,7 @@ namespace Umbraco.Tests.Integration.Testing
|
||||
// Ensure CoreRuntime stopped (now it's a HostedService)
|
||||
IHost host = Services.GetRequiredService<IHost>();
|
||||
host.StopAsync().GetAwaiter().GetResult();
|
||||
host.Dispose();
|
||||
}
|
||||
|
||||
[TearDown]
|
||||
|
||||
@@ -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<PublishedSnapshotServiceEventHandler>().Dispose();
|
||||
base.TearDown();
|
||||
}
|
||||
|
||||
private void AssertJsonStartsWith(int id, string expected)
|
||||
{
|
||||
var json = GetJson(id).Replace('"', '\'');
|
||||
|
||||
Reference in New Issue
Block a user