Cleanup AddUmbraco & AddUmbracoCore

This commit is contained in:
Paul Johnson
2020-11-20 12:24:16 +00:00
parent 5e2de50382
commit 0241649f7f
9 changed files with 245 additions and 311 deletions

View File

@@ -5,6 +5,7 @@ using Umbraco.Core.Cache;
using Umbraco.Core.Runtime;
using Umbraco.Extensions;
using Umbraco.Tests.Integration.Implementations;
using Umbraco.Web.Common.Builder;
namespace Umbraco.Tests.Integration.TestServerTest
{
@@ -17,11 +18,7 @@ namespace Umbraco.Tests.Integration.TestServerTest
/// <returns></returns>
public static IUmbracoBuilder AddTestCore(this IUmbracoBuilder builder, TestHelper testHelper)
{
builder.AddUmbracoCore(
testHelper.GetWebHostEnvironment(),
typeof(UmbracoBuilderExtensions).Assembly,
testHelper.GetLoggingConfiguration(),
builder.Config);
builder.AddUmbracoCore();
builder.Services.AddUnique<AppCaches>(AppCaches.NoCache);

View File

@@ -130,9 +130,12 @@ namespace Umbraco.Tests.Integration.TestServerTest
public override void ConfigureServices(IServiceCollection services)
{
var umbracoBuilder = services.AddUmbraco(TestHelper.GetWebHostEnvironment(), Configuration, assembly: GetType().Assembly);
var typeLoader = services.AddTypeLoader(GetType().Assembly, TestHelper.GetWebHostEnvironment(),
TestHelper.ConsoleLoggerFactory, AppCaches.NoCache, Configuration);
var builder = new UmbracoBuilder(services, Configuration, typeLoader);
umbracoBuilder
builder
.AddConfiguration()
.AddTestCore(TestHelper) // This is the important one!
.AddWebComponents()