Current.Container abstracted. Builds, but fails for collection builder tests.

This commit is contained in:
Lars-Erik Aabech
2018-06-16 13:13:29 +02:00
parent 9b1bd3be60
commit e3d77fb012
13 changed files with 84 additions and 13 deletions

View File

@@ -8,6 +8,7 @@ using NUnit.Framework;
using Umbraco.Core;
using Umbraco.Core.Cache;
using Umbraco.Core.Composing;
using Umbraco.Core.Composing.LightInject;
using Umbraco.Core.Configuration.UmbracoSettings;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
@@ -43,7 +44,7 @@ namespace Umbraco.Tests.Web
container.Setup(x => x.GetInstance(typeof(TypeLoader))).Returns(
new TypeLoader(NullCacheProvider.Instance, SettingsForTests.GenerateMockGlobalSettings(), new ProfilingLogger(Mock.Of<ILogger>(), Mock.Of<IProfiler>())));
container.Setup(x => x.GetInstance(typeof (ServiceContext))).Returns(serviceContext);
Current.Container = container.Object;
Current.Container = new ContainerAdapter(container.Object);
Umbraco.Web.Composing.Current.UmbracoContextAccessor = new TestUmbracoContextAccessor();