Inject IHostingEnvironment to UmbracoBuilder to fix integration tests

This commit is contained in:
Ronald Barendse
2021-08-19 09:08:12 +02:00
parent d6cfc900f3
commit 7ccc434bd6
2 changed files with 5 additions and 3 deletions

View File

@@ -134,15 +134,17 @@ namespace Umbraco.Cms.Tests.Integration.TestServerTest
public override void ConfigureServices(IServiceCollection services)
{
services.AddTransient<TestUmbracoDatabaseFactoryProvider>();
Core.Hosting.IHostingEnvironment hostingEnvironment = TestHelper.GetHostingEnvironment();
TypeLoader typeLoader = services.AddTypeLoader(
GetType().Assembly,
TestHelper.GetHostingEnvironment(),
hostingEnvironment,
TestHelper.ConsoleLoggerFactory,
AppCaches.NoCache,
Configuration,
TestHelper.Profiler);
var builder = new UmbracoBuilder(services, Configuration, typeLoader);
var builder = new UmbracoBuilder(services, Configuration, typeLoader, TestHelper.ConsoleLoggerFactory, TestHelper.Profiler, AppCaches.NoCache, hostingEnvironment);
builder
.AddConfiguration()

View File

@@ -212,7 +212,7 @@ namespace Umbraco.Cms.Tests.Integration.Testing
TestHelper.Profiler);
var builder = new UmbracoBuilder(services, Configuration, typeLoader, TestHelper.ConsoleLoggerFactory, TestHelper.Profiler, AppCaches.NoCache, hostingEnvironment);
builder.Services.AddLogger(TestHelper.GetHostingEnvironment(), TestHelper.GetLoggingConfiguration(), Configuration);
builder.Services.AddLogger(hostingEnvironment, TestHelper.GetLoggingConfiguration(), Configuration);
builder.AddConfiguration()
.AddUmbracoCore()