Refactor runtimes, injection and composition

This commit is contained in:
Stephan
2018-11-26 16:54:32 +01:00
parent 8b74453c13
commit b8608f1b2e
73 changed files with 711 additions and 829 deletions

View File

@@ -3,6 +3,7 @@ using NPoco;
using NUnit.Framework;
using Umbraco.Core;
using Umbraco.Core.Cache;
using Umbraco.Core.Components;
using Umbraco.Core.Logging;
using Umbraco.Core.Persistence.Mappers;
using Umbraco.Core.Persistence.SqlSyntax;
@@ -33,6 +34,7 @@ namespace Umbraco.Tests.TestHelpers
var sqlSyntax = new SqlCeSyntaxProvider();
var container = Current.Container = ContainerFactory.Create();
var composition = new Composition(container, RuntimeLevel.Run);
container.RegisterSingleton<ILogger>(factory => Mock.Of<ILogger>());
container.RegisterSingleton<IProfiler>(factory => Mock.Of<IProfiler>());
@@ -44,7 +46,7 @@ namespace Umbraco.Tests.TestHelpers
false);
container.RegisterInstance(pluginManager);
container.RegisterCollectionBuilder<MapperCollectionBuilder>()
composition.GetCollectionBuilder<MapperCollectionBuilder>()
.Add(() => Current.TypeLoader.GetAssignedMapperTypes());
Mappers = container.GetInstance<IMapperCollection>();