diff --git a/src/Umbraco.Core/Runtime/CoreRuntime.cs b/src/Umbraco.Core/Runtime/CoreRuntime.cs index 237dcece64..70ee3ce0bd 100644 --- a/src/Umbraco.Core/Runtime/CoreRuntime.cs +++ b/src/Umbraco.Core/Runtime/CoreRuntime.cs @@ -153,7 +153,7 @@ namespace Umbraco.Core.Runtime composers.Compose(); // create the factory - _factory = Current.Factory = composition.CreateFactory(); + _factory = Current.Factory = CurrentCore.Factory = composition.CreateFactory(); // create & initialize the components _components = _factory.GetInstance(); @@ -178,7 +178,7 @@ namespace Umbraco.Core.Runtime { try { - _factory = Current.Factory = composition?.CreateFactory(); + _factory = Current.Factory = CurrentCore.Factory = composition?.CreateFactory(); } catch { /* yea */ } } diff --git a/src/Umbraco.Tests/Cache/DistributedCache/DistributedCacheTests.cs b/src/Umbraco.Tests/Cache/DistributedCache/DistributedCacheTests.cs index b752cb6a90..33a1aa16a5 100644 --- a/src/Umbraco.Tests/Cache/DistributedCache/DistributedCacheTests.cs +++ b/src/Umbraco.Tests/Cache/DistributedCache/DistributedCacheTests.cs @@ -35,6 +35,7 @@ namespace Umbraco.Tests.Cache.DistributedCache .Add(); Current.Factory = composition.CreateFactory(); + CurrentCore.Factory = composition.CreateFactory(); _distributedCache = new Umbraco.Web.Cache.DistributedCache(); } diff --git a/src/Umbraco.Tests/Composing/PackageActionCollectionTests.cs b/src/Umbraco.Tests/Composing/PackageActionCollectionTests.cs index 0073a4d624..bf79b340dc 100644 --- a/src/Umbraco.Tests/Composing/PackageActionCollectionTests.cs +++ b/src/Umbraco.Tests/Composing/PackageActionCollectionTests.cs @@ -27,6 +27,7 @@ namespace Umbraco.Tests.Composing .Add(() => TypeLoader.GetPackageActions()); Current.Factory = composition.CreateFactory(); + CurrentCore.Factory = composition.CreateFactory(); var actions = Current.PackageActions; Assert.AreEqual(2, actions.Count()); diff --git a/src/Umbraco.Tests/CoreThings/UdiTests.cs b/src/Umbraco.Tests/CoreThings/UdiTests.cs index 2770803bea..8a5450a5ab 100644 --- a/src/Umbraco.Tests/CoreThings/UdiTests.cs +++ b/src/Umbraco.Tests/CoreThings/UdiTests.cs @@ -29,6 +29,7 @@ namespace Umbraco.Tests.CoreThings container.Setup(x => x.GetInstance(typeof(TypeLoader))).Returns( new TypeLoader(NoAppCache.Instance, IOHelper.MapPath("~/App_Data/TEMP"), new ProfilingLogger(Mock.Of(), Mock.Of()))); Current.Factory = container.Object; + CurrentCore.Factory = container.Object; Udi.ResetUdiTypes(); } diff --git a/src/Umbraco.Tests/IO/FileSystemsTests.cs b/src/Umbraco.Tests/IO/FileSystemsTests.cs index 2a32a1bc27..bcbaca3917 100644 --- a/src/Umbraco.Tests/IO/FileSystemsTests.cs +++ b/src/Umbraco.Tests/IO/FileSystemsTests.cs @@ -47,6 +47,7 @@ namespace Umbraco.Tests.IO Current.Reset(); Current.Factory = _factory; + CurrentCore.Factory = _factory; // make sure we start clean // because some tests will create corrupt or weird filesystems diff --git a/src/Umbraco.Tests/Manifest/ManifestParserTests.cs b/src/Umbraco.Tests/Manifest/ManifestParserTests.cs index 0a187c5a8a..f01e307b4b 100644 --- a/src/Umbraco.Tests/Manifest/ManifestParserTests.cs +++ b/src/Umbraco.Tests/Manifest/ManifestParserTests.cs @@ -27,6 +27,7 @@ namespace Umbraco.Tests.Manifest Current.Reset(); var factory = Mock.Of(); Current.Factory = factory; + CurrentCore.Factory = factory; var serviceContext = ServiceContext.CreatePartial( localizedTextService: Mock.Of()); diff --git a/src/Umbraco.Tests/Models/VariationTests.cs b/src/Umbraco.Tests/Models/VariationTests.cs index ce78287d6d..ef788bcdbe 100644 --- a/src/Umbraco.Tests/Models/VariationTests.cs +++ b/src/Umbraco.Tests/Models/VariationTests.cs @@ -34,6 +34,7 @@ namespace Umbraco.Tests.Models var factory = Mock.Of(); Current.Factory = factory; + CurrentCore.Factory = factory; var dataEditors = new DataEditorCollection(new IDataEditor[] { diff --git a/src/Umbraco.Tests/PropertyEditors/ImageCropperTest.cs b/src/Umbraco.Tests/PropertyEditors/ImageCropperTest.cs index dcf225d952..7a7c8ae2ec 100644 --- a/src/Umbraco.Tests/PropertyEditors/ImageCropperTest.cs +++ b/src/Umbraco.Tests/PropertyEditors/ImageCropperTest.cs @@ -75,6 +75,7 @@ namespace Umbraco.Tests.PropertyEditors composition.WithCollectionBuilder(); Current.Factory = composition.CreateFactory(); + CurrentCore.Factory = composition.CreateFactory(); var logger = Mock.Of(); var scheme = Mock.Of(); diff --git a/src/Umbraco.Tests/PropertyEditors/PropertyEditorValueEditorTests.cs b/src/Umbraco.Tests/PropertyEditors/PropertyEditorValueEditorTests.cs index c1b80b97b1..19549f66fe 100644 --- a/src/Umbraco.Tests/PropertyEditors/PropertyEditorValueEditorTests.cs +++ b/src/Umbraco.Tests/PropertyEditors/PropertyEditorValueEditorTests.cs @@ -31,6 +31,7 @@ namespace Umbraco.Tests.PropertyEditors => new DefaultShortStringHelper(new DefaultShortStringHelperConfig().WithDefault(SettingsForTests.GetDefaultUmbracoSettings()))); Current.Factory = composition.CreateFactory(); + CurrentCore.Factory = composition.CreateFactory(); } [TearDown] diff --git a/src/Umbraco.Tests/Published/ConvertersTests.cs b/src/Umbraco.Tests/Published/ConvertersTests.cs index 01e14edf12..061736a884 100644 --- a/src/Umbraco.Tests/Published/ConvertersTests.cs +++ b/src/Umbraco.Tests/Published/ConvertersTests.cs @@ -193,6 +193,7 @@ namespace Umbraco.Tests.Published register.Register(f => factory); Current.Factory = composition.CreateFactory(); + CurrentCore.Factory = composition.CreateFactory(); var cacheMock = new Mock(); var cacheContent = new Dictionary(); diff --git a/src/Umbraco.Tests/PublishedContent/NuCacheChildrenTests.cs b/src/Umbraco.Tests/PublishedContent/NuCacheChildrenTests.cs index f08d77a80f..7dd1241951 100644 --- a/src/Umbraco.Tests/PublishedContent/NuCacheChildrenTests.cs +++ b/src/Umbraco.Tests/PublishedContent/NuCacheChildrenTests.cs @@ -53,6 +53,7 @@ namespace Umbraco.Tests.PublishedContent var factory = Mock.Of(); Current.Factory = factory; + CurrentCore.Factory = factory; var configs = new ConfigsFactory().Create(); Mock.Get(factory).Setup(x => x.GetInstance(typeof(Configs))).Returns(configs); diff --git a/src/Umbraco.Tests/PublishedContent/NuCacheTests.cs b/src/Umbraco.Tests/PublishedContent/NuCacheTests.cs index 7dba201b0a..782bb2bfa3 100644 --- a/src/Umbraco.Tests/PublishedContent/NuCacheTests.cs +++ b/src/Umbraco.Tests/PublishedContent/NuCacheTests.cs @@ -48,6 +48,7 @@ namespace Umbraco.Tests.PublishedContent var factory = Mock.Of(); Current.Factory = factory; + CurrentCore.Factory = factory; var configs = new ConfigsFactory().Create(); Mock.Get(factory).Setup(x => x.GetInstance(typeof(Configs))).Returns(configs); diff --git a/src/Umbraco.Tests/Runtimes/StandaloneTests.cs b/src/Umbraco.Tests/Runtimes/StandaloneTests.cs index b1e2f24564..16908e027d 100644 --- a/src/Umbraco.Tests/Runtimes/StandaloneTests.cs +++ b/src/Umbraco.Tests/Runtimes/StandaloneTests.cs @@ -59,7 +59,7 @@ namespace Umbraco.Tests.Runtimes var logger = new ConsoleLogger(new MessageTemplates()); var profiler = new LogProfiler(logger); var profilingLogger = new ProfilingLogger(logger, profiler); - var appCaches = AppCaches.Disabled; + var appCaches = AppCaches.Disabled; var databaseFactory = new UmbracoDatabaseFactory(logger, new Lazy(() => factory.GetInstance())); var typeLoader = new TypeLoader(appCaches.RuntimeCache, IOHelper.MapPath("~/App_Data/TEMP"), profilingLogger); var mainDom = new SimpleMainDom(); @@ -116,7 +116,7 @@ namespace Umbraco.Tests.Runtimes composition.Configs.Add(SettingsForTests.GetDefaultUmbracoSettings); // create and register the factory - Current.Factory = factory = composition.CreateFactory(); + Current.Factory = CurrentCore.Factory = factory = composition.CreateFactory(); // instantiate and initialize components var components = factory.GetInstance(); diff --git a/src/Umbraco.Tests/Scoping/ScopeEventDispatcherTests.cs b/src/Umbraco.Tests/Scoping/ScopeEventDispatcherTests.cs index 1597ef35cc..921c62e11f 100644 --- a/src/Umbraco.Tests/Scoping/ScopeEventDispatcherTests.cs +++ b/src/Umbraco.Tests/Scoping/ScopeEventDispatcherTests.cs @@ -44,7 +44,7 @@ namespace Umbraco.Tests.Scoping composition.Configs.Add(SettingsForTests.GetDefaultUmbracoSettings); Current.Reset(); - Current.Factory = composition.CreateFactory(); + Current.Factory = CurrentCore.Factory = composition.CreateFactory(); SettingsForTests.Reset(); // ensure we have configuration } diff --git a/src/Umbraco.Tests/TestHelpers/BaseUsingSqlCeSyntax.cs b/src/Umbraco.Tests/TestHelpers/BaseUsingSqlCeSyntax.cs index a042803639..2a4db7dcef 100644 --- a/src/Umbraco.Tests/TestHelpers/BaseUsingSqlCeSyntax.cs +++ b/src/Umbraco.Tests/TestHelpers/BaseUsingSqlCeSyntax.cs @@ -54,7 +54,7 @@ namespace Umbraco.Tests.TestHelpers composition.RegisterUnique(_ => SqlContext); - var factory = Current.Factory = composition.CreateFactory(); + var factory = Current.Factory = CurrentCore.Factory = composition.CreateFactory(); var pocoMappers = new NPoco.MapperCollection { new PocoMapper() }; var pocoDataFactory = new FluentPocoDataFactory((type, iPocoDataFactory) => new PocoDataBuilder(type, pocoMappers).Init()); diff --git a/src/Umbraco.Tests/Testing/UmbracoTestBase.cs b/src/Umbraco.Tests/Testing/UmbracoTestBase.cs index a45ac1caa7..d337108cc9 100644 --- a/src/Umbraco.Tests/Testing/UmbracoTestBase.cs +++ b/src/Umbraco.Tests/Testing/UmbracoTestBase.cs @@ -145,7 +145,7 @@ namespace Umbraco.Tests.Testing TestObjects = new TestObjects(register); Compose(); - Current.Factory = Factory = Composition.CreateFactory(); + Current.Factory = CurrentCore.Factory = Factory = Composition.CreateFactory(); Initialize(); } diff --git a/src/Umbraco.Tests/Web/Mvc/RenderIndexActionSelectorAttributeTests.cs b/src/Umbraco.Tests/Web/Mvc/RenderIndexActionSelectorAttributeTests.cs index eeb1eb4b37..ba66b04a6e 100644 --- a/src/Umbraco.Tests/Web/Mvc/RenderIndexActionSelectorAttributeTests.cs +++ b/src/Umbraco.Tests/Web/Mvc/RenderIndexActionSelectorAttributeTests.cs @@ -34,6 +34,7 @@ namespace Umbraco.Tests.Web.Mvc { Current.UmbracoContextAccessor = new TestUmbracoContextAccessor(); Core.Composing.Current.Factory = Mock.Of(); + Core.Composing.CurrentCore.Factory = Mock.Of(); } [TearDown] diff --git a/src/Umbraco.Tests/Web/TemplateUtilitiesTests.cs b/src/Umbraco.Tests/Web/TemplateUtilitiesTests.cs index 3a5405548b..3fcd22cb5a 100644 --- a/src/Umbraco.Tests/Web/TemplateUtilitiesTests.cs +++ b/src/Umbraco.Tests/Web/TemplateUtilitiesTests.cs @@ -46,7 +46,7 @@ namespace Umbraco.Tests.Web var settings = SettingsForTests.GetDefaultUmbracoSettings(); factory.Setup(x => x.GetInstance(typeof(IUmbracoSettingsSection))).Returns(settings); - Current.Factory = factory.Object; + Current.Factory = CurrentCore.Factory = factory.Object; Umbraco.Web.Composing.Current.UmbracoContextAccessor = new TestUmbracoContextAccessor(); diff --git a/src/Umbraco.Tests/Web/UmbracoHelperTests.cs b/src/Umbraco.Tests/Web/UmbracoHelperTests.cs index 26d85f60cf..1841c06adb 100644 --- a/src/Umbraco.Tests/Web/UmbracoHelperTests.cs +++ b/src/Umbraco.Tests/Web/UmbracoHelperTests.cs @@ -270,7 +270,7 @@ namespace Umbraco.Tests.Web ) ); - Current.Factory = container.Object; + Current.Factory = CurrentCore.Factory = container.Object; } } }