Updates CoreRuntime with better dependencies so we can disable caches, fixes integration test to run multiple callbacks registered for TearDown, ensure we TearDown the runtime.

This commit is contained in:
Shannon
2020-09-04 00:27:43 +10:00
parent 775360ef78
commit 7c78b5b34f
15 changed files with 133 additions and 90 deletions

View File

@@ -49,8 +49,8 @@ namespace Umbraco.Tests.Integration.TestServerTest
});
Client = Factory.CreateClient(new WebApplicationFactoryClientOptions
{
AllowAutoRedirect = false
{
AllowAutoRedirect = false
});
LinkGenerator = Factory.Services.GetRequiredService<LinkGenerator>();
@@ -62,9 +62,10 @@ namespace Umbraco.Tests.Integration.TestServerTest
{
var builder = base.CreateHostBuilder();
builder.ConfigureWebHost(builder =>
{
{
// need to configure the IWebHostEnvironment too
builder.ConfigureServices((c, s) => {
builder.ConfigureServices((c, s) =>
{
c.HostingEnvironment = TestHelper.GetWebHostEnvironment();
});
@@ -74,8 +75,8 @@ namespace Umbraco.Tests.Integration.TestServerTest
Services = app.ApplicationServices;
Configure(app);
});
})
.UseEnvironment(Environments.Development);
}).UseEnvironment(Environments.Development);
return builder;
}
@@ -140,14 +141,14 @@ namespace Umbraco.Tests.Integration.TestServerTest
//.WithMiniProfiler() // we don't want this running in tests
.WithMvcAndRazor(mvcBuilding: mvcBuilder =>
{
mvcBuilder.AddApplicationPart(typeof(ContentController).Assembly);
mvcBuilder.AddApplicationPart(typeof(ContentController).Assembly);
})
.WithWebServer()
.Build();
}
public override void Configure(IApplicationBuilder app)
{
{
app.UseUmbraco();
}