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

@@ -4,6 +4,7 @@ using System.Linq;
using NUnit.Framework;
using Umbraco.Core;
using Umbraco.Core.Cache;
using Umbraco.Core.Components;
using Umbraco.Core.Composing;
using Umbraco.Core.Sync;
@@ -21,11 +22,12 @@ namespace Umbraco.Tests.Cache.DistributedCache
public void Setup()
{
var container = Current.Container = ContainerFactory.Create();
var composition = new Composition(container, RuntimeLevel.Run);
container.Register<IServerRegistrar>(_ => new TestServerRegistrar());
container.RegisterSingleton<IServerMessenger>(_ => new TestServerMessenger());
container.RegisterCollectionBuilder<CacheRefresherCollectionBuilder>()
composition.GetCollectionBuilder<CacheRefresherCollectionBuilder>()
.Add<TestCacheRefresher>();
_distributedCache = new Umbraco.Web.Cache.DistributedCache();