diff --git a/src/Umbraco.Tests/PublishedContent/PublishedContentLanguageVariantTests.cs b/src/Umbraco.Tests/PublishedContent/PublishedContentLanguageVariantTests.cs index 2288ff80c2..4b431d18e6 100644 --- a/src/Umbraco.Tests/PublishedContent/PublishedContentLanguageVariantTests.cs +++ b/src/Umbraco.Tests/PublishedContent/PublishedContentLanguageVariantTests.cs @@ -16,7 +16,7 @@ using Umbraco.Web; namespace Umbraco.Tests.PublishedContent { [TestFixture] - [UmbracoTest(PluginManager = UmbracoTestOptions.PluginManager.PerFixture)] + [UmbracoTest(TypeLoader = UmbracoTestOptions.TypeLoader.PerFixture)] public class PublishedContentLanguageVariantTests : PublishedContentSnapshotTestBase { protected override void Compose() diff --git a/src/Umbraco.Tests/PublishedContent/PublishedContentMoreTests.cs b/src/Umbraco.Tests/PublishedContent/PublishedContentMoreTests.cs index 22965ac141..2732fb465a 100644 --- a/src/Umbraco.Tests/PublishedContent/PublishedContentMoreTests.cs +++ b/src/Umbraco.Tests/PublishedContent/PublishedContentMoreTests.cs @@ -8,7 +8,7 @@ using Umbraco.Tests.Testing; namespace Umbraco.Tests.PublishedContent { [TestFixture] - [UmbracoTest(PluginManager = UmbracoTestOptions.PluginManager.PerFixture)] + [UmbracoTest(TypeLoader = UmbracoTestOptions.TypeLoader.PerFixture)] public class PublishedContentMoreTests : PublishedContentSnapshotTestBase { internal override void PopulateCache(PublishedContentTypeFactory factory, SolidPublishedContentCache cache) diff --git a/src/Umbraco.Tests/PublishedContent/PublishedContentSnapshotTestBase.cs b/src/Umbraco.Tests/PublishedContent/PublishedContentSnapshotTestBase.cs index 623472a023..85432768f0 100644 --- a/src/Umbraco.Tests/PublishedContent/PublishedContentSnapshotTestBase.cs +++ b/src/Umbraco.Tests/PublishedContent/PublishedContentSnapshotTestBase.cs @@ -40,9 +40,9 @@ namespace Umbraco.Tests.PublishedContent Container.RegisterSingleton(f => new PublishedModelFactory(f.GetInstance().GetTypes())); } - protected override TypeLoader CreatePluginManager(IServiceFactory f) + protected override TypeLoader CreateTypeLoader(IServiceFactory f) { - var pluginManager = base.CreatePluginManager(f); + var pluginManager = base.CreateTypeLoader(f); // this is so the model factory looks into the test assembly pluginManager.AssembliesToScan = pluginManager.AssembliesToScan diff --git a/src/Umbraco.Tests/PublishedContent/PublishedContentTests.cs b/src/Umbraco.Tests/PublishedContent/PublishedContentTests.cs index 14dae46bcb..ed7affa79e 100644 --- a/src/Umbraco.Tests/PublishedContent/PublishedContentTests.cs +++ b/src/Umbraco.Tests/PublishedContent/PublishedContentTests.cs @@ -25,7 +25,7 @@ namespace Umbraco.Tests.PublishedContent /// Tests the methods on IPublishedContent using the DefaultPublishedContentStore /// [TestFixture] - [UmbracoTest(PluginManager = UmbracoTestOptions.PluginManager.PerFixture)] + [UmbracoTest(TypeLoader = UmbracoTestOptions.TypeLoader.PerFixture)] public class PublishedContentTests : PublishedContentTestBase { protected override void Compose() @@ -72,9 +72,9 @@ namespace Umbraco.Tests.PublishedContent ContentTypesCache.GetPublishedContentTypeByAlias = alias => type; } - protected override TypeLoader CreatePluginManager(IServiceFactory f) + protected override TypeLoader CreateTypeLoader(IServiceFactory f) { - var pluginManager = base.CreatePluginManager(f); + var pluginManager = base.CreateTypeLoader(f); // this is so the model factory looks into the test assembly pluginManager.AssembliesToScan = pluginManager.AssembliesToScan diff --git a/src/Umbraco.Tests/Testing/UmbracoTestAttribute.cs b/src/Umbraco.Tests/Testing/UmbracoTestAttribute.cs index 723ce43c6c..2bf4ba2716 100644 --- a/src/Umbraco.Tests/Testing/UmbracoTestAttribute.cs +++ b/src/Umbraco.Tests/Testing/UmbracoTestAttribute.cs @@ -48,8 +48,8 @@ namespace Umbraco.Tests.Testing /// Gets or sets a value indicating the required plugin manager support. /// /// Default is to use the global tests plugin manager. - public UmbracoTestOptions.PluginManager PluginManager { get => _pluginManager.ValueOrDefault(UmbracoTestOptions.PluginManager.Default); set => _pluginManager.Set(value); } - private readonly Settable _pluginManager = new Settable(); + public UmbracoTestOptions.TypeLoader TypeLoader { get => _typeLoader.ValueOrDefault(UmbracoTestOptions.TypeLoader.Default); set => _typeLoader.Set(value); } + private readonly Settable _typeLoader = new Settable(); protected override TestOptionAttributeBase Merge(TestOptionAttributeBase other) { @@ -62,7 +62,7 @@ namespace Umbraco.Tests.Testing _publishedRepositoryEvents.Set(attr._publishedRepositoryEvents); _logger.Set(attr._logger); _database.Set(attr._database); - _pluginManager.Set(attr._pluginManager); + _typeLoader.Set(attr._typeLoader); return this; } diff --git a/src/Umbraco.Tests/Testing/UmbracoTestBase.cs b/src/Umbraco.Tests/Testing/UmbracoTestBase.cs index 1eb222cd6a..c7c493c64d 100644 --- a/src/Umbraco.Tests/Testing/UmbracoTestBase.cs +++ b/src/Umbraco.Tests/Testing/UmbracoTestBase.cs @@ -135,7 +135,7 @@ namespace Umbraco.Tests.Testing ComposeLogging(Options.Logger); ComposeCacheHelper(); ComposeAutoMapper(Options.AutoMapper); - ComposePluginManager(Options.PluginManager); + ComposeTypeLoader(Options.TypeLoader); ComposeDatabase(Options.Database); ComposeApplication(Options.WithApplication); @@ -230,30 +230,30 @@ namespace Umbraco.Tests.Testing Container.RegisterFrom(); } - protected virtual void ComposePluginManager(UmbracoTestOptions.PluginManager pluginManager) + protected virtual void ComposeTypeLoader(UmbracoTestOptions.TypeLoader typeLoader) { Container.RegisterSingleton(f => { - switch (pluginManager) + switch (typeLoader) { - case UmbracoTestOptions.PluginManager.Default: - return _commonTypeLoader ?? (_commonTypeLoader = CreateCommonPluginManager(f)); - case UmbracoTestOptions.PluginManager.PerFixture: - return _featureTypeLoader ?? (_featureTypeLoader = CreatePluginManager(f)); - case UmbracoTestOptions.PluginManager.PerTest: - return CreatePluginManager(f); + case UmbracoTestOptions.TypeLoader.Default: + return _commonTypeLoader ?? (_commonTypeLoader = CreateCommonTypeLoader(f)); + case UmbracoTestOptions.TypeLoader.PerFixture: + return _featureTypeLoader ?? (_featureTypeLoader = CreateTypeLoader(f)); + case UmbracoTestOptions.TypeLoader.PerTest: + return CreateTypeLoader(f); default: - throw new ArgumentOutOfRangeException(nameof(pluginManager)); + throw new ArgumentOutOfRangeException(nameof(typeLoader)); } }); } - protected virtual TypeLoader CreatePluginManager(IServiceFactory f) + protected virtual TypeLoader CreateTypeLoader(IServiceFactory f) { - return CreateCommonPluginManager(f); + return CreateCommonTypeLoader(f); } - private static TypeLoader CreateCommonPluginManager(IServiceFactory f) + private static TypeLoader CreateCommonTypeLoader(IServiceFactory f) { return new TypeLoader(f.GetInstance().RuntimeCache, f.GetInstance(), f.GetInstance(), false) { diff --git a/src/Umbraco.Tests/Testing/UmbracoTestOptions.cs b/src/Umbraco.Tests/Testing/UmbracoTestOptions.cs index 5248026788..2d62f104d1 100644 --- a/src/Umbraco.Tests/Testing/UmbracoTestOptions.cs +++ b/src/Umbraco.Tests/Testing/UmbracoTestOptions.cs @@ -26,7 +26,7 @@ NewSchemaPerTest } - public enum PluginManager + public enum TypeLoader { // the default, global plugin manager for tests Default,