diff --git a/src/Umbraco.Tests/Cache/PublishedCache/PublishedContentCacheTests.cs b/src/Umbraco.Tests/Cache/PublishedCache/PublishedContentCacheTests.cs index 20ebf27ec6..e9d0583441 100644 --- a/src/Umbraco.Tests/Cache/PublishedCache/PublishedContentCacheTests.cs +++ b/src/Umbraco.Tests/Cache/PublishedCache/PublishedContentCacheTests.cs @@ -6,6 +6,7 @@ using umbraco.BusinessLogic; using Umbraco.Core.Cache; using Umbraco.Core.Models.PublishedContent; using Umbraco.Tests.TestHelpers; +using Umbraco.Tests.Testing; using Umbraco.Web; using Umbraco.Web.PublishedCache; using Umbraco.Web.PublishedCache.XmlPublishedCache; diff --git a/src/Umbraco.Tests/Cache/PublishedCache/PublishedMediaCacheTests.cs b/src/Umbraco.Tests/Cache/PublishedCache/PublishedMediaCacheTests.cs index 7eba6798a5..a8e3ad9fc0 100644 --- a/src/Umbraco.Tests/Cache/PublishedCache/PublishedMediaCacheTests.cs +++ b/src/Umbraco.Tests/Cache/PublishedCache/PublishedMediaCacheTests.cs @@ -12,6 +12,7 @@ using Umbraco.Core.Strings; using Umbraco.Tests.TestHelpers; using Umbraco.Web.PublishedCache.XmlPublishedCache; using Umbraco.Core.DI; +using Umbraco.Tests.Testing; using Current = Umbraco.Web.Current; namespace Umbraco.Tests.Cache.PublishedCache diff --git a/src/Umbraco.Tests/CoreThings/TryConvertToTests.cs b/src/Umbraco.Tests/CoreThings/TryConvertToTests.cs index 0a992db4f6..d91832777b 100644 --- a/src/Umbraco.Tests/CoreThings/TryConvertToTests.cs +++ b/src/Umbraco.Tests/CoreThings/TryConvertToTests.cs @@ -4,6 +4,7 @@ using Umbraco.Core; using Umbraco.Core.Strings; using Umbraco.Tests.TestHelpers; using Umbraco.Core.DI; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.CoreThings { diff --git a/src/Umbraco.Tests/CoreXml/NavigableNavigatorTests.cs b/src/Umbraco.Tests/CoreXml/NavigableNavigatorTests.cs index 0279763e0e..02dbe558cb 100644 --- a/src/Umbraco.Tests/CoreXml/NavigableNavigatorTests.cs +++ b/src/Umbraco.Tests/CoreXml/NavigableNavigatorTests.cs @@ -10,12 +10,12 @@ using System.Xml.Xsl; using Umbraco.Core.Xml; using Umbraco.Core.Xml.XPath; using NUnit.Framework; -using Umbraco.Tests.TestHelpers; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.CoreXml { [TestFixture] - public class NavigableNavigatorTests : TestWithSettingsBase + public class NavigableNavigatorTests : UmbracoTestBase { [Test] public void NewNavigatorIsAtRoot() diff --git a/src/Umbraco.Tests/Integration/ContentEventsTests.cs b/src/Umbraco.Tests/Integration/ContentEventsTests.cs index 4aee642ca9..ad9c200421 100644 --- a/src/Umbraco.Tests/Integration/ContentEventsTests.cs +++ b/src/Umbraco.Tests/Integration/ContentEventsTests.cs @@ -15,6 +15,7 @@ using Umbraco.Tests.Cache.DistributedCache; using Umbraco.Tests.Services; using Umbraco.Tests.TestHelpers; using Umbraco.Tests.TestHelpers.Entities; +using Umbraco.Tests.Testing; using Umbraco.Web.Cache; namespace Umbraco.Tests.Integration diff --git a/src/Umbraco.Tests/Integration/GetCultureTests.cs b/src/Umbraco.Tests/Integration/GetCultureTests.cs index 1e5d55d823..5926817755 100644 --- a/src/Umbraco.Tests/Integration/GetCultureTests.cs +++ b/src/Umbraco.Tests/Integration/GetCultureTests.cs @@ -5,6 +5,7 @@ using Umbraco.Core.Models; using Umbraco.Tests.Services; using Umbraco.Tests.TestHelpers; using Umbraco.Tests.TestHelpers.Entities; +using Umbraco.Tests.Testing; using Umbraco.Web.Routing; namespace Umbraco.Tests.Integration diff --git a/src/Umbraco.Tests/Migrations/MigrationIssuesTests.cs b/src/Umbraco.Tests/Migrations/MigrationIssuesTests.cs index cebbe90cb1..a83468643f 100644 --- a/src/Umbraco.Tests/Migrations/MigrationIssuesTests.cs +++ b/src/Umbraco.Tests/Migrations/MigrationIssuesTests.cs @@ -12,6 +12,7 @@ using Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionEight; using Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven; using Umbraco.Core.Services; using Umbraco.Tests.TestHelpers; +using Umbraco.Tests.Testing; using GlobalSettings = Umbraco.Core.Configuration.GlobalSettings; namespace Umbraco.Tests.Migrations diff --git a/src/Umbraco.Tests/Models/Collections/PropertyCollectionTests.cs b/src/Umbraco.Tests/Models/Collections/PropertyCollectionTests.cs index 8cb323c4f9..2459649a36 100644 --- a/src/Umbraco.Tests/Models/Collections/PropertyCollectionTests.cs +++ b/src/Umbraco.Tests/Models/Collections/PropertyCollectionTests.cs @@ -3,13 +3,13 @@ using System.Linq; using NUnit.Framework; using Umbraco.Core; using Umbraco.Core.Models; -using Umbraco.Tests.TestHelpers; using Umbraco.Tests.TestHelpers.Entities; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Models.Collections { [TestFixture] - public class PropertyCollectionTests : TestWithSettingsBase + public class PropertyCollectionTests : UmbracoTestBase { [Test] public void Property_Adds_Case_Insensitive_Compare() diff --git a/src/Umbraco.Tests/Models/ContentExtensionsTests.cs b/src/Umbraco.Tests/Models/ContentExtensionsTests.cs index 2ab6129687..63d76d8d55 100644 --- a/src/Umbraco.Tests/Models/ContentExtensionsTests.cs +++ b/src/Umbraco.Tests/Models/ContentExtensionsTests.cs @@ -2,13 +2,13 @@ using System.Linq; using NUnit.Framework; using Umbraco.Core.Models; -using Umbraco.Tests.TestHelpers; using Umbraco.Tests.TestHelpers.Entities; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Models { [TestFixture] - public class ContentExtensionsTests : TestWithSettingsBase + public class ContentExtensionsTests : UmbracoTestBase { #region RequiresSaving diff --git a/src/Umbraco.Tests/Models/ContentTests.cs b/src/Umbraco.Tests/Models/ContentTests.cs index c335bbfdde..8eb268c767 100644 --- a/src/Umbraco.Tests/Models/ContentTests.cs +++ b/src/Umbraco.Tests/Models/ContentTests.cs @@ -5,12 +5,10 @@ using System.Globalization; using System.IO; using System.Linq; using System.Web; -using LightInject; using Moq; using NUnit.Framework; using Umbraco.Core.Cache; using Umbraco.Core.Configuration.UmbracoSettings; -using Umbraco.Core.DI; using Umbraco.Core.IO; using Umbraco.Core.Logging; using Umbraco.Core.Models; @@ -21,11 +19,12 @@ using Umbraco.Core.Services; using Umbraco.Tests.TestHelpers; using Umbraco.Tests.TestHelpers.Entities; using Umbraco.Tests.TestHelpers.Stubs; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Models { [TestFixture] - public class ContentTests : TestWithSettingsBase + public class ContentTests : UmbracoTestBase { public override void SetUp() { diff --git a/src/Umbraco.Tests/Models/ContentTypeTests.cs b/src/Umbraco.Tests/Models/ContentTypeTests.cs index 7006fdd722..ab129c644e 100644 --- a/src/Umbraco.Tests/Models/ContentTypeTests.cs +++ b/src/Umbraco.Tests/Models/ContentTypeTests.cs @@ -2,19 +2,18 @@ using System; using System.Diagnostics; using System.Linq; using NUnit.Framework; -using Umbraco.Core; using Umbraco.Core.Logging; using Umbraco.Core.Models; using Umbraco.Core.Models.EntityBase; using Umbraco.Core.Serialization; -using Umbraco.Tests.TestHelpers; using Umbraco.Tests.TestHelpers.Entities; using Umbraco.Tests.TestHelpers.Stubs; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Models { [TestFixture] - public class ContentTypeTests : TestWithSettingsBase + public class ContentTypeTests : UmbracoTestBase { diff --git a/src/Umbraco.Tests/Models/ContentXmlTest.cs b/src/Umbraco.Tests/Models/ContentXmlTest.cs index 616f8a3365..ef083ca378 100644 --- a/src/Umbraco.Tests/Models/ContentXmlTest.cs +++ b/src/Umbraco.Tests/Models/ContentXmlTest.cs @@ -6,6 +6,7 @@ using Umbraco.Core.Models; using Umbraco.Core.Strings; using Umbraco.Tests.TestHelpers; using Umbraco.Tests.TestHelpers.Entities; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Models { diff --git a/src/Umbraco.Tests/Models/Mapping/AutoMapperTests.cs b/src/Umbraco.Tests/Models/Mapping/AutoMapperTests.cs index f6b7660a41..2658c38d4e 100644 --- a/src/Umbraco.Tests/Models/Mapping/AutoMapperTests.cs +++ b/src/Umbraco.Tests/Models/Mapping/AutoMapperTests.cs @@ -8,6 +8,7 @@ using Umbraco.Core.Cache; using Umbraco.Core.Manifest; using Umbraco.Core.PropertyEditors; using Umbraco.Tests.TestHelpers; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Models.Mapping { diff --git a/src/Umbraco.Tests/Models/Mapping/ContentWebModelMappingTests.cs b/src/Umbraco.Tests/Models/Mapping/ContentWebModelMappingTests.cs index 1ebae82e2c..38418a411d 100644 --- a/src/Umbraco.Tests/Models/Mapping/ContentWebModelMappingTests.cs +++ b/src/Umbraco.Tests/Models/Mapping/ContentWebModelMappingTests.cs @@ -14,6 +14,7 @@ using Umbraco.Tests.TestHelpers.Entities; using Umbraco.Web.Models.ContentEditing; using Umbraco.Core.DI; using Umbraco.Core.Plugins; +using Umbraco.Tests.Testing; using Current = Umbraco.Web.Current; namespace Umbraco.Tests.Models.Mapping diff --git a/src/Umbraco.Tests/Models/MediaXmlTest.cs b/src/Umbraco.Tests/Models/MediaXmlTest.cs index 86934ee7a2..a5fed2a4f5 100644 --- a/src/Umbraco.Tests/Models/MediaXmlTest.cs +++ b/src/Umbraco.Tests/Models/MediaXmlTest.cs @@ -11,6 +11,7 @@ using Umbraco.Core.Services; using Umbraco.Core.Strings; using Umbraco.Tests.TestHelpers; using Umbraco.Tests.TestHelpers.Entities; +using Umbraco.Tests.Testing; using Umbraco.Web.PropertyEditors; namespace Umbraco.Tests.Models diff --git a/src/Umbraco.Tests/Models/PropertyGroupTests.cs b/src/Umbraco.Tests/Models/PropertyGroupTests.cs index a33a47ed57..e96d116976 100644 --- a/src/Umbraco.Tests/Models/PropertyGroupTests.cs +++ b/src/Umbraco.Tests/Models/PropertyGroupTests.cs @@ -3,12 +3,12 @@ using System.Diagnostics; using NUnit.Framework; using Umbraco.Core.Models; using Umbraco.Core.Serialization; -using Umbraco.Tests.TestHelpers; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Models { [TestFixture] - public class PropertyGroupTests : TestWithSettingsBase + public class PropertyGroupTests : UmbracoTestBase { [Test] public void Can_Deep_Clone() diff --git a/src/Umbraco.Tests/Models/PropertyTypeTests.cs b/src/Umbraco.Tests/Models/PropertyTypeTests.cs index 57a49e2eec..cb85e0b21f 100644 --- a/src/Umbraco.Tests/Models/PropertyTypeTests.cs +++ b/src/Umbraco.Tests/Models/PropertyTypeTests.cs @@ -3,12 +3,12 @@ using System.Diagnostics; using NUnit.Framework; using Umbraco.Core.Models; using Umbraco.Core.Serialization; -using Umbraco.Tests.TestHelpers; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Models { [TestFixture] - public class PropertyTypeTests : TestWithSettingsBase + public class PropertyTypeTests : UmbracoTestBase { [Test] public void Can_Deep_Clone() diff --git a/src/Umbraco.Tests/Models/TemplateTests.cs b/src/Umbraco.Tests/Models/TemplateTests.cs index ef81cdc880..b6a5803772 100644 --- a/src/Umbraco.Tests/Models/TemplateTests.cs +++ b/src/Umbraco.Tests/Models/TemplateTests.cs @@ -5,12 +5,12 @@ using System.Reflection; using NUnit.Framework; using Umbraco.Core.Models; using Umbraco.Core.Serialization; -using Umbraco.Tests.TestHelpers; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Models { [TestFixture] - public class TemplateTests : TestWithSettingsBase + public class TemplateTests : UmbracoTestBase { [Test] public void Can_Deep_Clone() diff --git a/src/Umbraco.Tests/Persistence/LocksTests.cs b/src/Umbraco.Tests/Persistence/LocksTests.cs index 0ade0f54ad..d38e3085de 100644 --- a/src/Umbraco.Tests/Persistence/LocksTests.cs +++ b/src/Umbraco.Tests/Persistence/LocksTests.cs @@ -11,6 +11,7 @@ using Umbraco.Core.Persistence; using Umbraco.Tests.Services; using Umbraco.Tests.TestHelpers; using Umbraco.Core.DI; +using Umbraco.Tests.Testing; using Umbraco.Web; namespace Umbraco.Tests.Persistence diff --git a/src/Umbraco.Tests/Persistence/NPocoExtensionsTest.cs b/src/Umbraco.Tests/Persistence/NPocoExtensionsTest.cs index e4c024e754..0c2881e335 100644 --- a/src/Umbraco.Tests/Persistence/NPocoExtensionsTest.cs +++ b/src/Umbraco.Tests/Persistence/NPocoExtensionsTest.cs @@ -9,6 +9,7 @@ using Umbraco.Core.Models.Rdbms; using Umbraco.Core.Persistence; using Umbraco.Core.Persistence.SqlSyntax; using Umbraco.Tests.TestHelpers; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Persistence { diff --git a/src/Umbraco.Tests/Persistence/PetaPocoCachesTest.cs b/src/Umbraco.Tests/Persistence/PetaPocoCachesTest.cs index 8a7fd50440..6172dcaa1b 100644 --- a/src/Umbraco.Tests/Persistence/PetaPocoCachesTest.cs +++ b/src/Umbraco.Tests/Persistence/PetaPocoCachesTest.cs @@ -10,6 +10,7 @@ using Umbraco.Core.Services; using Umbraco.Tests.Services; using Umbraco.Tests.TestHelpers; using Umbraco.Tests.TestHelpers.Entities; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Persistence { diff --git a/src/Umbraco.Tests/Persistence/Querying/ContentTypeSqlMappingTests.cs b/src/Umbraco.Tests/Persistence/Querying/ContentTypeSqlMappingTests.cs index e3ffa643f6..9e12a171c7 100644 --- a/src/Umbraco.Tests/Persistence/Querying/ContentTypeSqlMappingTests.cs +++ b/src/Umbraco.Tests/Persistence/Querying/ContentTypeSqlMappingTests.cs @@ -12,6 +12,7 @@ using Umbraco.Core.Persistence; using Umbraco.Core.Persistence.Repositories; using Umbraco.Core.Persistence.SqlSyntax; using Umbraco.Tests.TestHelpers; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Persistence.Querying { diff --git a/src/Umbraco.Tests/Persistence/Repositories/AuditRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/AuditRepositoryTest.cs index 4ed5a11254..cbba268b3b 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/AuditRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/AuditRepositoryTest.cs @@ -5,6 +5,7 @@ using Umbraco.Core.Models.Rdbms; using Umbraco.Core.Persistence.Repositories; using Umbraco.Core.Persistence.UnitOfWork; using Umbraco.Tests.TestHelpers; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Persistence.Repositories { diff --git a/src/Umbraco.Tests/Persistence/Repositories/ContentRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/ContentRepositoryTest.cs index 03e6bab17e..6a43386617 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/ContentRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/ContentRepositoryTest.cs @@ -22,6 +22,7 @@ using Umbraco.Tests.TestHelpers.Entities; using Umbraco.Core.Models.EntityBase; using Umbraco.Core.Persistence.DatabaseModelDefinitions; using Umbraco.Core.Persistence.SqlSyntax; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Persistence.Repositories { diff --git a/src/Umbraco.Tests/Persistence/Repositories/ContentTypeRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/ContentTypeRepositoryTest.cs index 5920caad9b..9bfb501d18 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/ContentTypeRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/ContentTypeRepositoryTest.cs @@ -19,6 +19,7 @@ using Umbraco.Core.Persistence.Repositories; using Umbraco.Core.Persistence.UnitOfWork; using Umbraco.Tests.TestHelpers; using Umbraco.Tests.TestHelpers.Entities; +using Umbraco.Tests.Testing; using Umbraco.Web.Models.ContentEditing; namespace Umbraco.Tests.Persistence.Repositories diff --git a/src/Umbraco.Tests/Persistence/Repositories/DataTypeDefinitionRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/DataTypeDefinitionRepositoryTest.cs index 6f6b817e40..a556989a72 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/DataTypeDefinitionRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/DataTypeDefinitionRepositoryTest.cs @@ -11,6 +11,7 @@ using Umbraco.Core.Persistence.Repositories; using Umbraco.Core.Persistence.UnitOfWork; using Umbraco.Tests.TestHelpers; using Umbraco.Core.DI; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Persistence.Repositories { diff --git a/src/Umbraco.Tests/Persistence/Repositories/DictionaryRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/DictionaryRepositoryTest.cs index 2643e37432..6fefb092c5 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/DictionaryRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/DictionaryRepositoryTest.cs @@ -12,6 +12,7 @@ using Umbraco.Core.Persistence.Repositories; using Umbraco.Core.Persistence.SqlSyntax; using Umbraco.Core.Persistence.UnitOfWork; using Umbraco.Tests.TestHelpers; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Persistence.Repositories { diff --git a/src/Umbraco.Tests/Persistence/Repositories/DomainRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/DomainRepositoryTest.cs index e265bd334f..8510de199a 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/DomainRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/DomainRepositoryTest.cs @@ -10,6 +10,7 @@ using Umbraco.Core.Persistence.Repositories; using Umbraco.Core.Persistence.UnitOfWork; using Umbraco.Tests.TestHelpers; using Umbraco.Tests.TestHelpers.Entities; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Persistence.Repositories { diff --git a/src/Umbraco.Tests/Persistence/Repositories/LanguageRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/LanguageRepositoryTest.cs index 3433fe0419..d95342c8f2 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/LanguageRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/LanguageRepositoryTest.cs @@ -12,6 +12,7 @@ using Umbraco.Core.Persistence.Querying; using Umbraco.Core.Persistence.Repositories; using Umbraco.Core.Persistence.UnitOfWork; using Umbraco.Tests.TestHelpers; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Persistence.Repositories { diff --git a/src/Umbraco.Tests/Persistence/Repositories/MacroRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/MacroRepositoryTest.cs index b621d14274..f7701914d9 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/MacroRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/MacroRepositoryTest.cs @@ -12,6 +12,7 @@ using Umbraco.Core.Persistence.Querying; using Umbraco.Core.Persistence.Repositories; using Umbraco.Core.Persistence.UnitOfWork; using Umbraco.Tests.TestHelpers; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Persistence.Repositories { diff --git a/src/Umbraco.Tests/Persistence/Repositories/MediaRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/MediaRepositoryTest.cs index 186d62b64e..a640805dd8 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/MediaRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/MediaRepositoryTest.cs @@ -15,6 +15,7 @@ using Umbraco.Core.Persistence.UnitOfWork; using Umbraco.Tests.TestHelpers; using Umbraco.Tests.TestHelpers.Entities; using Umbraco.Core.Persistence.DatabaseModelDefinitions; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Persistence.Repositories { diff --git a/src/Umbraco.Tests/Persistence/Repositories/MediaTypeRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/MediaTypeRepositoryTest.cs index 4aef30b23b..4a008bff37 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/MediaTypeRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/MediaTypeRepositoryTest.cs @@ -13,6 +13,7 @@ using Umbraco.Core.Persistence.SqlSyntax; using Umbraco.Core.Persistence.UnitOfWork; using Umbraco.Tests.TestHelpers; using Umbraco.Tests.TestHelpers.Entities; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Persistence.Repositories { diff --git a/src/Umbraco.Tests/Persistence/Repositories/MemberRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/MemberRepositoryTest.cs index 4d13646ec9..621269a035 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/MemberRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/MemberRepositoryTest.cs @@ -17,6 +17,7 @@ using Umbraco.Core.Persistence.Repositories; using Umbraco.Core.Persistence.UnitOfWork; using Umbraco.Tests.TestHelpers; using Umbraco.Tests.TestHelpers.Entities; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Persistence.Repositories { diff --git a/src/Umbraco.Tests/Persistence/Repositories/MemberTypeRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/MemberTypeRepositoryTest.cs index 3fe96a3f0b..f663d1ad26 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/MemberTypeRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/MemberTypeRepositoryTest.cs @@ -12,6 +12,7 @@ using Umbraco.Core.Persistence.Repositories; using Umbraco.Core.Persistence.UnitOfWork; using Umbraco.Tests.TestHelpers; using Umbraco.Tests.TestHelpers.Entities; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Persistence.Repositories { diff --git a/src/Umbraco.Tests/Persistence/Repositories/NotificationsRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/NotificationsRepositoryTest.cs index ed616195b7..1bd2ff4ac9 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/NotificationsRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/NotificationsRepositoryTest.cs @@ -10,6 +10,7 @@ using Umbraco.Core.Models.Rdbms; using Umbraco.Core.Persistence.Repositories; using Umbraco.Core.Persistence.UnitOfWork; using Umbraco.Tests.TestHelpers; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Persistence.Repositories { diff --git a/src/Umbraco.Tests/Persistence/Repositories/PublicAccessRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/PublicAccessRepositoryTest.cs index 0427a59435..636653d5c6 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/PublicAccessRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/PublicAccessRepositoryTest.cs @@ -12,6 +12,7 @@ using Umbraco.Core.Persistence.Repositories; using Umbraco.Core.Persistence.UnitOfWork; using Umbraco.Tests.TestHelpers; using Umbraco.Tests.TestHelpers.Entities; +using Umbraco.Tests.Testing; using Content = Umbraco.Core.Models.Content; namespace Umbraco.Tests.Persistence.Repositories diff --git a/src/Umbraco.Tests/Persistence/Repositories/RedirectUrlRepositoryTests.cs b/src/Umbraco.Tests/Persistence/Repositories/RedirectUrlRepositoryTests.cs index 938c1250eb..643b8ef165 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/RedirectUrlRepositoryTests.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/RedirectUrlRepositoryTests.cs @@ -7,6 +7,7 @@ using Umbraco.Core.Persistence.Repositories; using Umbraco.Core.Persistence.UnitOfWork; using Umbraco.Tests.TestHelpers; using Umbraco.Tests.TestHelpers.Entities; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Persistence.Repositories { diff --git a/src/Umbraco.Tests/Persistence/Repositories/RelationRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/RelationRepositoryTest.cs index 291ceb9d78..be929cbb7c 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/RelationRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/RelationRepositoryTest.cs @@ -14,6 +14,7 @@ using Umbraco.Core.Persistence.Repositories; using Umbraco.Core.Persistence.UnitOfWork; using Umbraco.Tests.TestHelpers; using Umbraco.Tests.TestHelpers.Entities; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Persistence.Repositories { diff --git a/src/Umbraco.Tests/Persistence/Repositories/RelationTypeRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/RelationTypeRepositoryTest.cs index 468d5de86d..617109eb01 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/RelationTypeRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/RelationTypeRepositoryTest.cs @@ -13,6 +13,7 @@ using Umbraco.Core.Persistence.Querying; using Umbraco.Core.Persistence.Repositories; using Umbraco.Core.Persistence.UnitOfWork; using Umbraco.Tests.TestHelpers; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Persistence.Repositories { diff --git a/src/Umbraco.Tests/Persistence/Repositories/ServerRegistrationRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/ServerRegistrationRepositoryTest.cs index 270c7258a0..96e07e5aec 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/ServerRegistrationRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/ServerRegistrationRepositoryTest.cs @@ -12,6 +12,7 @@ using Umbraco.Core.Persistence.Querying; using Umbraco.Core.Persistence.Repositories; using Umbraco.Core.Persistence.UnitOfWork; using Umbraco.Tests.TestHelpers; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Persistence.Repositories { diff --git a/src/Umbraco.Tests/Persistence/Repositories/StylesheetRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/StylesheetRepositoryTest.cs index cf2d36f6e1..11204cb084 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/StylesheetRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/StylesheetRepositoryTest.cs @@ -11,6 +11,7 @@ using Umbraco.Core.Models; using Umbraco.Core.Persistence.Repositories; using Umbraco.Core.Persistence.UnitOfWork; using Umbraco.Tests.TestHelpers; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Persistence.Repositories { diff --git a/src/Umbraco.Tests/Persistence/Repositories/TagRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/TagRepositoryTest.cs index 487abbdd61..0b2856700b 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/TagRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/TagRepositoryTest.cs @@ -14,6 +14,7 @@ using Umbraco.Core.Persistence.Repositories; using Umbraco.Core.Persistence.UnitOfWork; using Umbraco.Tests.TestHelpers; using Umbraco.Tests.TestHelpers.Entities; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Persistence.Repositories { diff --git a/src/Umbraco.Tests/Persistence/Repositories/TaskRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/TaskRepositoryTest.cs index 6fb1c9c0c2..bd40f5b57b 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/TaskRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/TaskRepositoryTest.cs @@ -6,6 +6,7 @@ using Umbraco.Core.Models; using Umbraco.Core.Persistence.Repositories; using Umbraco.Core.Persistence.UnitOfWork; using Umbraco.Tests.TestHelpers; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Persistence.Repositories { diff --git a/src/Umbraco.Tests/Persistence/Repositories/TaskTypeRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/TaskTypeRepositoryTest.cs index 7ec2cae6ce..248d2840d4 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/TaskTypeRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/TaskTypeRepositoryTest.cs @@ -5,6 +5,7 @@ using Umbraco.Core.Models; using Umbraco.Core.Persistence.Repositories; using Umbraco.Core.Persistence.UnitOfWork; using Umbraco.Tests.TestHelpers; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Persistence.Repositories { diff --git a/src/Umbraco.Tests/Persistence/Repositories/TemplateRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/TemplateRepositoryTest.cs index 51f3f8c343..8e3368602f 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/TemplateRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/TemplateRepositoryTest.cs @@ -18,6 +18,7 @@ using Umbraco.Core.Persistence.UnitOfWork; using Umbraco.Core.Services; using Umbraco.Tests.TestHelpers; using Umbraco.Tests.TestHelpers.Entities; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Persistence.Repositories { diff --git a/src/Umbraco.Tests/Persistence/Repositories/UserRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/UserRepositoryTest.cs index 14eea765cf..18e9bdcb30 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/UserRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/UserRepositoryTest.cs @@ -14,6 +14,7 @@ using Umbraco.Core.Persistence.Repositories; using Umbraco.Core.Persistence.UnitOfWork; using Umbraco.Tests.TestHelpers; using Umbraco.Tests.TestHelpers.Entities; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Persistence.Repositories { diff --git a/src/Umbraco.Tests/Persistence/Repositories/UserTypeRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/UserTypeRepositoryTest.cs index fff399868e..a19f15efa9 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/UserTypeRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/UserTypeRepositoryTest.cs @@ -12,6 +12,7 @@ using Umbraco.Core.Persistence.Repositories; using Umbraco.Core.Persistence.UnitOfWork; using Umbraco.Tests.TestHelpers; using Umbraco.Tests.TestHelpers.Entities; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Persistence.Repositories { diff --git a/src/Umbraco.Tests/Persistence/SchemaValidationTest.cs b/src/Umbraco.Tests/Persistence/SchemaValidationTest.cs index 8ea89aa8d4..0bfa91436b 100644 --- a/src/Umbraco.Tests/Persistence/SchemaValidationTest.cs +++ b/src/Umbraco.Tests/Persistence/SchemaValidationTest.cs @@ -5,6 +5,7 @@ using Umbraco.Core.Logging; using Umbraco.Core.Persistence.Migrations.Initial; using Umbraco.Core.Persistence.SqlSyntax; using Umbraco.Tests.TestHelpers; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Persistence { diff --git a/src/Umbraco.Tests/Persistence/SqlCeTableByTableTest.cs b/src/Umbraco.Tests/Persistence/SqlCeTableByTableTest.cs index db4b40cca3..e5b0337457 100644 --- a/src/Umbraco.Tests/Persistence/SqlCeTableByTableTest.cs +++ b/src/Umbraco.Tests/Persistence/SqlCeTableByTableTest.cs @@ -2,6 +2,7 @@ using Umbraco.Core.Models.Rdbms; using Umbraco.Core.Persistence; using Umbraco.Tests.TestHelpers; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Persistence { diff --git a/src/Umbraco.Tests/Persistence/UnitOfWorkTests.cs b/src/Umbraco.Tests/Persistence/UnitOfWorkTests.cs index 68877b7a62..549680263d 100644 --- a/src/Umbraco.Tests/Persistence/UnitOfWorkTests.cs +++ b/src/Umbraco.Tests/Persistence/UnitOfWorkTests.cs @@ -2,6 +2,7 @@ using NUnit.Framework; using Umbraco.Core; using Umbraco.Tests.TestHelpers; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Persistence { diff --git a/src/Umbraco.Tests/PublishedContent/PublishedContentExtensionTests.cs b/src/Umbraco.Tests/PublishedContent/PublishedContentExtensionTests.cs index adcc3b540e..632161a576 100644 --- a/src/Umbraco.Tests/PublishedContent/PublishedContentExtensionTests.cs +++ b/src/Umbraco.Tests/PublishedContent/PublishedContentExtensionTests.cs @@ -5,6 +5,7 @@ using System.Text; using NUnit.Framework; using Umbraco.Core.Models; using Umbraco.Tests.TestHelpers; +using Umbraco.Tests.Testing; using Umbraco.Web; namespace Umbraco.Tests.PublishedContent diff --git a/src/Umbraco.Tests/PublishedContent/PublishedMediaTests.cs b/src/Umbraco.Tests/PublishedContent/PublishedMediaTests.cs index 2f24e08f48..aa3a554b1a 100644 --- a/src/Umbraco.Tests/PublishedContent/PublishedMediaTests.cs +++ b/src/Umbraco.Tests/PublishedContent/PublishedMediaTests.cs @@ -19,6 +19,7 @@ using Umbraco.Core.Strings; using UmbracoExamine; using Current = Umbraco.Web.Current; using Umbraco.Core.DI; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.PublishedContent { diff --git a/src/Umbraco.Tests/Publishing/PublishingStrategyTests.cs b/src/Umbraco.Tests/Publishing/PublishingStrategyTests.cs index eb636d6d35..4876ff35bb 100644 --- a/src/Umbraco.Tests/Publishing/PublishingStrategyTests.cs +++ b/src/Umbraco.Tests/Publishing/PublishingStrategyTests.cs @@ -7,6 +7,7 @@ using Umbraco.Tests.TestHelpers; using Umbraco.Tests.TestHelpers.Entities; using System.Linq; using Umbraco.Core.Services; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Publishing { diff --git a/src/Umbraco.Tests/Routing/ContentFinderByNiceUrlAndTemplateTests.cs b/src/Umbraco.Tests/Routing/ContentFinderByNiceUrlAndTemplateTests.cs index 00cbd89bb3..007998c737 100644 --- a/src/Umbraco.Tests/Routing/ContentFinderByNiceUrlAndTemplateTests.cs +++ b/src/Umbraco.Tests/Routing/ContentFinderByNiceUrlAndTemplateTests.cs @@ -2,6 +2,7 @@ using NUnit.Framework; using Umbraco.Tests.TestHelpers; using Umbraco.Web.Routing; using Umbraco.Core.Models; +using Umbraco.Tests.Testing; using Current = Umbraco.Web.Current; namespace Umbraco.Tests.Routing diff --git a/src/Umbraco.Tests/Routing/ContentFinderByNiceUrlTests.cs b/src/Umbraco.Tests/Routing/ContentFinderByNiceUrlTests.cs index a27f3050f9..6a395b8135 100644 --- a/src/Umbraco.Tests/Routing/ContentFinderByNiceUrlTests.cs +++ b/src/Umbraco.Tests/Routing/ContentFinderByNiceUrlTests.cs @@ -1,5 +1,6 @@ using NUnit.Framework; using Umbraco.Tests.TestHelpers; +using Umbraco.Tests.Testing; using Umbraco.Web.Routing; namespace Umbraco.Tests.Routing diff --git a/src/Umbraco.Tests/Routing/NiceUrlProviderTests.cs b/src/Umbraco.Tests/Routing/NiceUrlProviderTests.cs index fb414bc95a..d2642f8d09 100644 --- a/src/Umbraco.Tests/Routing/NiceUrlProviderTests.cs +++ b/src/Umbraco.Tests/Routing/NiceUrlProviderTests.cs @@ -4,6 +4,7 @@ using Moq; using NUnit.Framework; using Umbraco.Core.Configuration.UmbracoSettings; using Umbraco.Tests.TestHelpers; +using Umbraco.Tests.Testing; using Umbraco.Web.PublishedCache.XmlPublishedCache; using Umbraco.Web.Routing; diff --git a/src/Umbraco.Tests/Routing/RenderRouteHandlerTests.cs b/src/Umbraco.Tests/Routing/RenderRouteHandlerTests.cs index 8c0e121e86..7b416d99c2 100644 --- a/src/Umbraco.Tests/Routing/RenderRouteHandlerTests.cs +++ b/src/Umbraco.Tests/Routing/RenderRouteHandlerTests.cs @@ -17,6 +17,7 @@ using Umbraco.Web.Routing; using Umbraco.Web.WebApi; using Umbraco.Core.Strings; using Umbraco.Core.DI; +using Umbraco.Tests.Testing; using Current = Umbraco.Web.Current; namespace Umbraco.Tests.Routing diff --git a/src/Umbraco.Tests/Routing/RoutesCacheTests.cs b/src/Umbraco.Tests/Routing/RoutesCacheTests.cs index 587ce2d5bb..83ee2363e6 100644 --- a/src/Umbraco.Tests/Routing/RoutesCacheTests.cs +++ b/src/Umbraco.Tests/Routing/RoutesCacheTests.cs @@ -5,6 +5,7 @@ using System.Text; using System.Threading.Tasks; using NUnit.Framework; using Umbraco.Tests.TestHelpers; +using Umbraco.Tests.Testing; using Umbraco.Web.PublishedCache.XmlPublishedCache; namespace Umbraco.Tests.Routing diff --git a/src/Umbraco.Tests/Routing/UrlRoutingTestBase.cs b/src/Umbraco.Tests/Routing/UrlRoutingTestBase.cs index 9c9f0967be..9176dc888d 100644 --- a/src/Umbraco.Tests/Routing/UrlRoutingTestBase.cs +++ b/src/Umbraco.Tests/Routing/UrlRoutingTestBase.cs @@ -6,6 +6,7 @@ using Umbraco.Core.DI; using Umbraco.Core.Models; using Umbraco.Core.Services; using Umbraco.Tests.TestHelpers; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Routing { diff --git a/src/Umbraco.Tests/Services/ContentServicePerformanceTest.cs b/src/Umbraco.Tests/Services/ContentServicePerformanceTest.cs index 19b2384558..3bf10eeb97 100644 --- a/src/Umbraco.Tests/Services/ContentServicePerformanceTest.cs +++ b/src/Umbraco.Tests/Services/ContentServicePerformanceTest.cs @@ -14,6 +14,7 @@ using Umbraco.Core.Persistence.Repositories; using Umbraco.Tests.TestHelpers; using Umbraco.Tests.TestHelpers.Entities; using Umbraco.Tests.TestHelpers.Stubs; +using Umbraco.Tests.Testing; using Current = Umbraco.Web.Current; namespace Umbraco.Tests.Services diff --git a/src/Umbraco.Tests/Services/ContentServiceTests.cs b/src/Umbraco.Tests/Services/ContentServiceTests.cs index c09ddb4def..a894f40720 100644 --- a/src/Umbraco.Tests/Services/ContentServiceTests.cs +++ b/src/Umbraco.Tests/Services/ContentServiceTests.cs @@ -21,6 +21,7 @@ using Umbraco.Tests.TestHelpers.Entities; using Umbraco.Core.DI; using Umbraco.Core.Events; using Umbraco.Tests.TestHelpers.Stubs; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Services { diff --git a/src/Umbraco.Tests/Services/ContentTypeServiceTests.cs b/src/Umbraco.Tests/Services/ContentTypeServiceTests.cs index 5051f5c2b8..30c12ae052 100644 --- a/src/Umbraco.Tests/Services/ContentTypeServiceTests.cs +++ b/src/Umbraco.Tests/Services/ContentTypeServiceTests.cs @@ -10,6 +10,7 @@ using Umbraco.Core.Models.Rdbms; using Umbraco.Core.Services; using Umbraco.Tests.TestHelpers; using Umbraco.Tests.TestHelpers.Entities; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Services { diff --git a/src/Umbraco.Tests/Services/DataTypeServiceTests.cs b/src/Umbraco.Tests/Services/DataTypeServiceTests.cs index 92aa427c3b..8ee8cf2497 100644 --- a/src/Umbraco.Tests/Services/DataTypeServiceTests.cs +++ b/src/Umbraco.Tests/Services/DataTypeServiceTests.cs @@ -6,6 +6,7 @@ using Umbraco.Core; using Umbraco.Core.Models; using Umbraco.Core.Models.Rdbms; using Umbraco.Tests.TestHelpers; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Services { diff --git a/src/Umbraco.Tests/Services/EntityServiceTests.cs b/src/Umbraco.Tests/Services/EntityServiceTests.cs index 3b7d6206ae..69136e5cb3 100644 --- a/src/Umbraco.Tests/Services/EntityServiceTests.cs +++ b/src/Umbraco.Tests/Services/EntityServiceTests.cs @@ -5,6 +5,7 @@ using Umbraco.Core; using Umbraco.Core.Models; using Umbraco.Tests.TestHelpers; using Umbraco.Tests.TestHelpers.Entities; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Services { diff --git a/src/Umbraco.Tests/Services/FileServiceTests.cs b/src/Umbraco.Tests/Services/FileServiceTests.cs index d44c086e27..ac1ef5b9e1 100644 --- a/src/Umbraco.Tests/Services/FileServiceTests.cs +++ b/src/Umbraco.Tests/Services/FileServiceTests.cs @@ -6,6 +6,7 @@ using System.Text; using System.Threading.Tasks; using NUnit.Framework; using Umbraco.Tests.TestHelpers; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Services { diff --git a/src/Umbraco.Tests/Services/Importing/PackageImportTests.cs b/src/Umbraco.Tests/Services/Importing/PackageImportTests.cs index acc65d8961..3c38eba386 100644 --- a/src/Umbraco.Tests/Services/Importing/PackageImportTests.cs +++ b/src/Umbraco.Tests/Services/Importing/PackageImportTests.cs @@ -7,6 +7,7 @@ using Umbraco.Core.Models; using Umbraco.Core; using Umbraco.Core.Models.Rdbms; using Umbraco.Tests.TestHelpers; +using Umbraco.Tests.Testing; using Current = Umbraco.Web.Current; namespace Umbraco.Tests.Services.Importing diff --git a/src/Umbraco.Tests/Services/LocalizationServiceTests.cs b/src/Umbraco.Tests/Services/LocalizationServiceTests.cs index 917bab621e..94d89351d2 100644 --- a/src/Umbraco.Tests/Services/LocalizationServiceTests.cs +++ b/src/Umbraco.Tests/Services/LocalizationServiceTests.cs @@ -6,6 +6,7 @@ using NUnit.Framework; using Umbraco.Core; using Umbraco.Core.Models; using Umbraco.Tests.TestHelpers; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Services { diff --git a/src/Umbraco.Tests/Services/MacroServiceTests.cs b/src/Umbraco.Tests/Services/MacroServiceTests.cs index 5e14dbe26f..c986b4ae0a 100644 --- a/src/Umbraco.Tests/Services/MacroServiceTests.cs +++ b/src/Umbraco.Tests/Services/MacroServiceTests.cs @@ -9,6 +9,7 @@ using Umbraco.Core.Models; using Umbraco.Core.Persistence.Repositories; using Umbraco.Core.Persistence.UnitOfWork; using Umbraco.Tests.TestHelpers; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Services { diff --git a/src/Umbraco.Tests/Services/MediaServiceTests.cs b/src/Umbraco.Tests/Services/MediaServiceTests.cs index 256f36adb4..a4299e1bd4 100644 --- a/src/Umbraco.Tests/Services/MediaServiceTests.cs +++ b/src/Umbraco.Tests/Services/MediaServiceTests.cs @@ -11,6 +11,7 @@ using Umbraco.Core.Persistence.Repositories; using Umbraco.Core.Persistence.UnitOfWork; using Umbraco.Tests.TestHelpers; using Umbraco.Tests.TestHelpers.Entities; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Services { diff --git a/src/Umbraco.Tests/Services/MemberServiceTests.cs b/src/Umbraco.Tests/Services/MemberServiceTests.cs index 9837857b69..b092d6fd98 100644 --- a/src/Umbraco.Tests/Services/MemberServiceTests.cs +++ b/src/Umbraco.Tests/Services/MemberServiceTests.cs @@ -16,6 +16,7 @@ using Umbraco.Core.Persistence.UnitOfWork; using Umbraco.Core.Services; using Umbraco.Tests.TestHelpers; using Umbraco.Tests.TestHelpers.Entities; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Services { diff --git a/src/Umbraco.Tests/Services/MemberTypeServiceTests.cs b/src/Umbraco.Tests/Services/MemberTypeServiceTests.cs index c80ad5e662..e67e08cfda 100644 --- a/src/Umbraco.Tests/Services/MemberTypeServiceTests.cs +++ b/src/Umbraco.Tests/Services/MemberTypeServiceTests.cs @@ -8,6 +8,7 @@ using Umbraco.Core.Models; using Umbraco.Core.Models.Rdbms; using Umbraco.Tests.TestHelpers; using Umbraco.Tests.TestHelpers.Entities; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Services { diff --git a/src/Umbraco.Tests/Services/PackagingServiceTests.cs b/src/Umbraco.Tests/Services/PackagingServiceTests.cs index bc412a45c8..5804478455 100644 --- a/src/Umbraco.Tests/Services/PackagingServiceTests.cs +++ b/src/Umbraco.Tests/Services/PackagingServiceTests.cs @@ -10,6 +10,7 @@ using Umbraco.Core.Models.Packaging; using Umbraco.Core.Services; using Umbraco.Tests.Services.Importing; using Umbraco.Tests.TestHelpers; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Services { diff --git a/src/Umbraco.Tests/Services/PerformanceTests.cs b/src/Umbraco.Tests/Services/PerformanceTests.cs index e8fbfd7105..d6ca6893d8 100644 --- a/src/Umbraco.Tests/Services/PerformanceTests.cs +++ b/src/Umbraco.Tests/Services/PerformanceTests.cs @@ -21,6 +21,7 @@ using Umbraco.Core.Services; using Umbraco.Tests.TestHelpers; using Umbraco.Tests.TestHelpers.Entities; using Umbraco.Tests.TestHelpers.Stubs; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Services { diff --git a/src/Umbraco.Tests/Services/PublicAccessServiceTests.cs b/src/Umbraco.Tests/Services/PublicAccessServiceTests.cs index 39196fdcf2..4b1b763546 100644 --- a/src/Umbraco.Tests/Services/PublicAccessServiceTests.cs +++ b/src/Umbraco.Tests/Services/PublicAccessServiceTests.cs @@ -5,6 +5,7 @@ using Umbraco.Core.Models; using Umbraco.Core.Services; using Umbraco.Tests.TestHelpers; using Umbraco.Tests.TestHelpers.Entities; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Services { diff --git a/src/Umbraco.Tests/Services/RelationServiceTests.cs b/src/Umbraco.Tests/Services/RelationServiceTests.cs index 074850da91..c4ae8023ec 100644 --- a/src/Umbraco.Tests/Services/RelationServiceTests.cs +++ b/src/Umbraco.Tests/Services/RelationServiceTests.cs @@ -3,6 +3,7 @@ using NUnit.Framework; using Umbraco.Core; using Umbraco.Core.Models; using Umbraco.Tests.TestHelpers; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Services { diff --git a/src/Umbraco.Tests/Services/TagServiceTests.cs b/src/Umbraco.Tests/Services/TagServiceTests.cs index 1a43a0b7f9..6084ee985b 100644 --- a/src/Umbraco.Tests/Services/TagServiceTests.cs +++ b/src/Umbraco.Tests/Services/TagServiceTests.cs @@ -4,6 +4,7 @@ using Umbraco.Core.Models; using Umbraco.Core.Services; using Umbraco.Tests.TestHelpers; using Umbraco.Tests.TestHelpers.Entities; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Services { diff --git a/src/Umbraco.Tests/Services/ThreadSafetyServiceTest.cs b/src/Umbraco.Tests/Services/ThreadSafetyServiceTest.cs index ebd01c254f..8bb2f89199 100644 --- a/src/Umbraco.Tests/Services/ThreadSafetyServiceTest.cs +++ b/src/Umbraco.Tests/Services/ThreadSafetyServiceTest.cs @@ -20,6 +20,7 @@ using Umbraco.Tests.TestHelpers.Entities; using Umbraco.Core.Persistence.Mappers; using Umbraco.Core.Persistence.Querying; using Umbraco.Core.DI; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Services { diff --git a/src/Umbraco.Tests/Services/UserServiceTests.cs b/src/Umbraco.Tests/Services/UserServiceTests.cs index 4c8f5fd08b..82c4301b05 100644 --- a/src/Umbraco.Tests/Services/UserServiceTests.cs +++ b/src/Umbraco.Tests/Services/UserServiceTests.cs @@ -7,6 +7,7 @@ using Umbraco.Core.Models.Membership; using Umbraco.Tests.TestHelpers.Entities; using Umbraco.Core.Persistence.Querying; using Umbraco.Tests.TestHelpers; +using Umbraco.Tests.Testing; using Umbraco.Web._Legacy.Actions; namespace Umbraco.Tests.Services diff --git a/src/Umbraco.Tests/Strings/CmsHelperCasingTests.cs b/src/Umbraco.Tests/Strings/CmsHelperCasingTests.cs index dd4ca6035b..b133632eda 100644 --- a/src/Umbraco.Tests/Strings/CmsHelperCasingTests.cs +++ b/src/Umbraco.Tests/Strings/CmsHelperCasingTests.cs @@ -2,6 +2,7 @@ using Umbraco.Core; using Umbraco.Core.Strings; using Umbraco.Tests.TestHelpers; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Strings { diff --git a/src/Umbraco.Tests/Strings/DefaultShortStringHelperTests.cs b/src/Umbraco.Tests/Strings/DefaultShortStringHelperTests.cs index 81c19cdd2e..6a74636e63 100644 --- a/src/Umbraco.Tests/Strings/DefaultShortStringHelperTests.cs +++ b/src/Umbraco.Tests/Strings/DefaultShortStringHelperTests.cs @@ -12,6 +12,7 @@ using Umbraco.Core.Configuration.UmbracoSettings; using Umbraco.Core.DI; using Umbraco.Core.Strings; using Umbraco.Tests.TestHelpers; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Strings { diff --git a/src/Umbraco.Tests/Strings/StringExtensionsTests.cs b/src/Umbraco.Tests/Strings/StringExtensionsTests.cs index 1118bc036e..e7e28cc1d7 100644 --- a/src/Umbraco.Tests/Strings/StringExtensionsTests.cs +++ b/src/Umbraco.Tests/Strings/StringExtensionsTests.cs @@ -6,6 +6,7 @@ using Umbraco.Core; using Umbraco.Core.DI; using Umbraco.Core.Strings; using Umbraco.Tests.TestHelpers; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Strings { diff --git a/src/Umbraco.Tests/Strings/StringValidationTests.cs b/src/Umbraco.Tests/Strings/StringValidationTests.cs index 6ce2e34547..b38c99a610 100644 --- a/src/Umbraco.Tests/Strings/StringValidationTests.cs +++ b/src/Umbraco.Tests/Strings/StringValidationTests.cs @@ -1,6 +1,7 @@ using System.ComponentModel.DataAnnotations; using NUnit.Framework; using Umbraco.Tests.TestHelpers; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Strings { diff --git a/src/Umbraco.Tests/Strings/StylesheetHelperTests.cs b/src/Umbraco.Tests/Strings/StylesheetHelperTests.cs index 73bdfbed72..ef046c1a94 100644 --- a/src/Umbraco.Tests/Strings/StylesheetHelperTests.cs +++ b/src/Umbraco.Tests/Strings/StylesheetHelperTests.cs @@ -4,6 +4,7 @@ using NUnit.Framework; using Umbraco.Core; using Umbraco.Core.Strings.Css; using Umbraco.Tests.TestHelpers; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.Strings { diff --git a/src/Umbraco.Tests/TestHelpers/TestWithApplicationBase.cs b/src/Umbraco.Tests/TestHelpers/TestWithApplicationBase.cs index e18bffa5b6..bb0eab321a 100644 --- a/src/Umbraco.Tests/TestHelpers/TestWithApplicationBase.cs +++ b/src/Umbraco.Tests/TestHelpers/TestWithApplicationBase.cs @@ -20,6 +20,7 @@ using Umbraco.Core.Persistence.Querying; using Umbraco.Core.Plugins; using Umbraco.Core.Services; using Umbraco.Tests.TestHelpers.Stubs; +using Umbraco.Tests.Testing; using Umbraco.Web.Services; using UmbracoExamine; @@ -36,7 +37,7 @@ namespace Umbraco.Tests.TestHelpers /// [TestFixture] [UmbracoTest(AutoMapper = true, ResetPluginManager = false)] - public abstract class TestWithApplicationBase : TestWithSettingsBase + public abstract class TestWithApplicationBase : UmbracoTestBase { protected ILogger Logger => Container.GetInstance(); diff --git a/src/Umbraco.Tests/TestHelpers/TestWithDatabaseBase.cs b/src/Umbraco.Tests/TestHelpers/TestWithDatabaseBase.cs index 59e49e0794..c306a0ff9b 100644 --- a/src/Umbraco.Tests/TestHelpers/TestWithDatabaseBase.cs +++ b/src/Umbraco.Tests/TestHelpers/TestWithDatabaseBase.cs @@ -34,6 +34,7 @@ using Umbraco.Core.Persistence.Mappers; using Umbraco.Core.Persistence.Querying; using Umbraco.Core.Strings; using Umbraco.Tests.TestHelpers.Stubs; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.TestHelpers { @@ -53,11 +54,6 @@ namespace Umbraco.Tests.TestHelpers private IFacadeService _facadeService; private IDisposable _databaseScope; - // note: a fixture class is created once for all the tests in that fixture - // these flags are used to ensure a new database file is used when appropriate - private static bool _isFirstInSession = true; // first test in the entire test session - private bool _isFirstInFixture = true; // first test in the test fixture - private string _databasePath; private static byte[] _databaseBytes; @@ -115,10 +111,6 @@ namespace Umbraco.Tests.TestHelpers public override void TearDown() { - // before anything else... - _isFirstInFixture = false; - _isFirstInSession = false; - var profilingLogger = Container.TryGetInstance(); var timer = profilingLogger?.TraceDuration("teardown"); // fixme move that one up try @@ -207,11 +199,11 @@ namespace Umbraco.Tests.TestHelpers // - _isFirstTestInFixture + DbInitBehavior.NewDbFileAndSchemaPerFixture //if this is the first test in the session, always ensure a new db file is created - if (_isFirstInSession + if (FirstTestInSession || File.Exists(_databasePath) == false || Options.Database == UmbracoTestOptions.Database.NewSchemaPerTest || Options.Database == UmbracoTestOptions.Database.NewEmptyPerTest - || (_isFirstInFixture && Options.Database == UmbracoTestOptions.Database.NewSchemaPerFixture)) + || (FirstTestInFixture && Options.Database == UmbracoTestOptions.Database.NewSchemaPerFixture)) { using (ProfilingLogger.TraceDuration("Remove database file")) { @@ -295,9 +287,9 @@ namespace Umbraco.Tests.TestHelpers // - _isFirstTestInFixture + DbInitBehavior.NewDbFileAndSchemaPerFixture if (_databaseBytes == null && - (_isFirstInSession + (FirstTestInSession || Options.Database == UmbracoTestOptions.Database.NewSchemaPerTest - || (_isFirstInFixture && Options.Database == UmbracoTestOptions.Database.NewSchemaPerFixture))) + || (FirstTestInFixture && Options.Database == UmbracoTestOptions.Database.NewSchemaPerFixture))) { var database = Core.DI.Current.DatabaseContext.Database; var schemaHelper = new DatabaseSchemaHelper(database, Logger); diff --git a/src/Umbraco.Tests/TestHelpers/TestWithSettingsBase.cs b/src/Umbraco.Tests/TestHelpers/TestWithSettingsBase.cs deleted file mode 100644 index d0d01cd10e..0000000000 --- a/src/Umbraco.Tests/TestHelpers/TestWithSettingsBase.cs +++ /dev/null @@ -1,31 +0,0 @@ -using NUnit.Framework; -using Umbraco.Tests.TestHelpers.Stubs; -using Current = Umbraco.Web.Current; - -namespace Umbraco.Tests.TestHelpers -{ - /// - /// Provides a base class for all Umbraco tests that use SettingsForTests. - /// - /// - /// Ensures that SettingsForTests is property resetted before and after each test executes. - /// Sets a test Umbraco context accessor. - /// - public abstract class TestWithSettingsBase : UmbracoTestBase - { - public override void SetUp() - { - base.SetUp(); - - SettingsForTests.Reset(); - Current.UmbracoContextAccessor = new TestUmbracoContextAccessor(); - } - - public override void TearDown() - { - base.TearDown(); - - SettingsForTests.Reset(); - } - } -} \ No newline at end of file diff --git a/src/Umbraco.Tests/Testing/MockTests.cs b/src/Umbraco.Tests/Testing/TestingTests/MockTests.cs similarity index 98% rename from src/Umbraco.Tests/Testing/MockTests.cs rename to src/Umbraco.Tests/Testing/TestingTests/MockTests.cs index 378ed628c1..d008e606c4 100644 --- a/src/Umbraco.Tests/Testing/MockTests.cs +++ b/src/Umbraco.Tests/Testing/TestingTests/MockTests.cs @@ -5,7 +5,6 @@ using NUnit.Framework; using Umbraco.Core; using Umbraco.Core.Cache; using Umbraco.Core.Dictionary; -using Umbraco.Core.Logging; using Umbraco.Core.Models.PublishedContent; using Umbraco.Core.Services; using Umbraco.Tests.TestHelpers; @@ -15,7 +14,7 @@ using Umbraco.Web.Routing; using Umbraco.Web.Security; using Current = Umbraco.Web.Current; -namespace Umbraco.Tests.Testing +namespace Umbraco.Tests.Testing.TestingTests { [TestFixture] public class MockTests : UmbracoTestBase diff --git a/src/Umbraco.Tests/Testing/NUnitTests.cs b/src/Umbraco.Tests/Testing/TestingTests/NUnitTests.cs similarity index 98% rename from src/Umbraco.Tests/Testing/NUnitTests.cs rename to src/Umbraco.Tests/Testing/TestingTests/NUnitTests.cs index bc8f660723..436a4648f5 100644 --- a/src/Umbraco.Tests/Testing/NUnitTests.cs +++ b/src/Umbraco.Tests/Testing/TestingTests/NUnitTests.cs @@ -1,6 +1,6 @@ using NUnit.Framework; -namespace Umbraco.Tests.Testing +namespace Umbraco.Tests.Testing.TestingTests { // these 4 test classes validate that our test class pattern *should* be: // - test base classes *not* marked as [TestFixture] but having a virtual SetUp diff --git a/src/Umbraco.Tests/TestHelpers/UmbracoTestAttribute.cs b/src/Umbraco.Tests/Testing/UmbracoTestAttribute.cs similarity index 98% rename from src/Umbraco.Tests/TestHelpers/UmbracoTestAttribute.cs rename to src/Umbraco.Tests/Testing/UmbracoTestAttribute.cs index 879e169d67..b70d667011 100644 --- a/src/Umbraco.Tests/TestHelpers/UmbracoTestAttribute.cs +++ b/src/Umbraco.Tests/Testing/UmbracoTestAttribute.cs @@ -3,7 +3,7 @@ using System.Linq; using System.Reflection; using Umbraco.Core; -namespace Umbraco.Tests.TestHelpers +namespace Umbraco.Tests.Testing { [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, /*AllowMultiple = false,*/ Inherited = false)] public class UmbracoTestAttribute : Attribute diff --git a/src/Umbraco.Tests/TestHelpers/UmbracoTestBase.cs b/src/Umbraco.Tests/Testing/UmbracoTestBase.cs similarity index 91% rename from src/Umbraco.Tests/TestHelpers/UmbracoTestBase.cs rename to src/Umbraco.Tests/Testing/UmbracoTestBase.cs index d96b443e8e..c65be1d6ca 100644 --- a/src/Umbraco.Tests/TestHelpers/UmbracoTestBase.cs +++ b/src/Umbraco.Tests/Testing/UmbracoTestBase.cs @@ -11,11 +11,13 @@ using Umbraco.Core.DI; using Umbraco.Core.Logging; using Umbraco.Core.Models.Mapping; using Umbraco.Core.Plugins; +using Umbraco.Tests.TestHelpers; +using Umbraco.Tests.TestHelpers.Stubs; using Umbraco.Web; using Umbraco.Web.DI; using Current = Umbraco.Core.DI.Current; -namespace Umbraco.Tests.TestHelpers +namespace Umbraco.Tests.Testing { /// /// Provides the top-level base class for all Umbraco integration tests. @@ -54,11 +56,13 @@ namespace Umbraco.Tests.TestHelpers protected UmbracoTestAttribute Options { get; private set; } + protected static bool FirstTestInSession = true; + + protected bool FirstTestInFixture = true; + internal TestObjects TestObjects { get; private set; } private static PluginManager _pluginManager; - private static bool _firstDatabaseInSession = true; - private bool _firstDatabaseInFixture = true; [SetUp] public virtual void SetUp() @@ -90,6 +94,7 @@ namespace Umbraco.Tests.TestHelpers ComposePluginManager(Options.ResetPluginManager); ComposeDatabase(Options.Database); // etc + ComposeWtf(); // not sure really var composition = new Composition(Container, RuntimeLevel.Run); @@ -122,6 +127,13 @@ namespace Umbraco.Tests.TestHelpers Container.RegisterSingleton(f => new ProfilingLogger(f.GetInstance(), f.GetInstance())); } + protected virtual void ComposeWtf() + { + // imported from TestWithSettingsBase + // which was inherited by TestWithApplicationBase so pretty much used everywhere + Umbraco.Web.Current.UmbracoContextAccessor = new TestUmbracoContextAccessor(); + } + protected virtual void ComposeCacheHelper() { Container.RegisterSingleton(f => CacheHelper.CreateDisabledCacheHelper()); @@ -188,6 +200,9 @@ namespace Umbraco.Tests.TestHelpers [TearDown] public virtual void TearDown() { + FirstTestInFixture = false; + FirstTestInSession = false; + Reset(); } @@ -200,6 +215,7 @@ namespace Umbraco.Tests.TestHelpers // reset all other static things that should not be static ;( UriUtility.ResetAppDomainAppVirtualPath(); + SettingsForTests.Reset(); // fixme - should it be optional? } #endregion diff --git a/src/Umbraco.Tests/TestHelpers/UmbracoTestOptions.cs b/src/Umbraco.Tests/Testing/UmbracoTestOptions.cs similarity index 94% rename from src/Umbraco.Tests/TestHelpers/UmbracoTestOptions.cs rename to src/Umbraco.Tests/Testing/UmbracoTestOptions.cs index 0cdcb1401e..67aab30fd5 100644 --- a/src/Umbraco.Tests/TestHelpers/UmbracoTestOptions.cs +++ b/src/Umbraco.Tests/Testing/UmbracoTestOptions.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Tests.TestHelpers +namespace Umbraco.Tests.Testing { public static class UmbracoTestOptions { diff --git a/src/Umbraco.Tests/TreesAndSections/ApplicationTreeTest.cs b/src/Umbraco.Tests/TreesAndSections/ApplicationTreeTest.cs index 83fd0f3229..61eef28d5d 100644 --- a/src/Umbraco.Tests/TreesAndSections/ApplicationTreeTest.cs +++ b/src/Umbraco.Tests/TreesAndSections/ApplicationTreeTest.cs @@ -4,6 +4,7 @@ using Umbraco.Core.Services; using Umbraco.Tests.TestHelpers; using System; using System.Linq; +using Umbraco.Tests.Testing; using Umbraco.Web.Services; using Current = Umbraco.Web.Current; diff --git a/src/Umbraco.Tests/TreesAndSections/SectionTests.cs b/src/Umbraco.Tests/TreesAndSections/SectionTests.cs index 4d087f1a54..310adec594 100644 --- a/src/Umbraco.Tests/TreesAndSections/SectionTests.cs +++ b/src/Umbraco.Tests/TreesAndSections/SectionTests.cs @@ -6,6 +6,7 @@ using umbraco.BusinessLogic; using System; using System.Linq; using Umbraco.Core; +using Umbraco.Tests.Testing; using Umbraco.Web.Services; namespace Umbraco.Tests.TreesAndSections diff --git a/src/Umbraco.Tests/Umbraco.Tests.csproj b/src/Umbraco.Tests/Umbraco.Tests.csproj index e687b2aa1c..d6b9a62085 100644 --- a/src/Umbraco.Tests/Umbraco.Tests.csproj +++ b/src/Umbraco.Tests/Umbraco.Tests.csproj @@ -237,7 +237,7 @@ - + @@ -245,10 +245,10 @@ - - + + - + @@ -299,7 +299,7 @@ - + @@ -491,7 +491,6 @@ - @@ -722,7 +721,9 @@ - + + + diff --git a/src/Umbraco.Tests/UmbracoExamine/EventsTest.cs b/src/Umbraco.Tests/UmbracoExamine/EventsTest.cs index bd820e2900..59e1f20539 100644 --- a/src/Umbraco.Tests/UmbracoExamine/EventsTest.cs +++ b/src/Umbraco.Tests/UmbracoExamine/EventsTest.cs @@ -5,6 +5,7 @@ using Examine.Session; using Lucene.Net.Store; using NUnit.Framework; using Umbraco.Tests.TestHelpers; +using Umbraco.Tests.Testing; using UmbracoExamine; namespace Umbraco.Tests.UmbracoExamine diff --git a/src/Umbraco.Tests/UmbracoExamine/IndexTest.cs b/src/Umbraco.Tests/UmbracoExamine/IndexTest.cs index 35ff0fe0d5..fd6f7a1de3 100644 --- a/src/Umbraco.Tests/UmbracoExamine/IndexTest.cs +++ b/src/Umbraco.Tests/UmbracoExamine/IndexTest.cs @@ -6,6 +6,7 @@ using Lucene.Net.Search; using Lucene.Net.Store; using NUnit.Framework; using Umbraco.Tests.TestHelpers; +using Umbraco.Tests.Testing; using UmbracoExamine; namespace Umbraco.Tests.UmbracoExamine diff --git a/src/Umbraco.Tests/UmbracoExamine/SearchTests.cs b/src/Umbraco.Tests/UmbracoExamine/SearchTests.cs index a95f051dc4..26d9ddf326 100644 --- a/src/Umbraco.Tests/UmbracoExamine/SearchTests.cs +++ b/src/Umbraco.Tests/UmbracoExamine/SearchTests.cs @@ -12,6 +12,7 @@ using Umbraco.Core.Persistence.DatabaseModelDefinitions; using Umbraco.Core.Persistence.Querying; using Umbraco.Core.Services; using Umbraco.Tests.TestHelpers; +using Umbraco.Tests.Testing; namespace Umbraco.Tests.UmbracoExamine { diff --git a/src/UmbracoExamine/UmbracoMemberIndexer.cs b/src/UmbracoExamine/UmbracoMemberIndexer.cs index 6356941950..9aafe3fb81 100644 --- a/src/UmbracoExamine/UmbracoMemberIndexer.cs +++ b/src/UmbracoExamine/UmbracoMemberIndexer.cs @@ -26,6 +26,7 @@ namespace UmbracoExamine public class UmbracoMemberIndexer : BaseUmbracoIndexer { private readonly IMemberService _memberService; + private readonly DatabaseContext _databaseContext; /// /// Default constructor @@ -34,6 +35,7 @@ namespace UmbracoExamine : base() { _memberService = Current.Services.MemberService; + _databaseContext = Current.DatabaseContext; } /// @@ -132,15 +134,31 @@ namespace UmbracoExamine IMember[] members; - if (IndexerData != null && IndexerData.IncludeNodeTypes.Any()) + using (_databaseContext.CreateDatabaseScope()) { - //if there are specific node types then just index those - foreach (var nodeType in IndexerData.IncludeNodeTypes) + if (IndexerData != null && IndexerData.IncludeNodeTypes.Any()) { + //if there are specific node types then just index those + foreach (var nodeType in IndexerData.IncludeNodeTypes) + { + do + { + long total; + members = _memberService.GetAll(pageIndex, pageSize, out total, "LoginName", Direction.Ascending, true, null, nodeType).ToArray(); + + IndexItems(GetValueSets(members)); + + pageIndex++; + } while (members.Length == pageSize); + } + } + else + { + //no node types specified, do all members do { long total; - members = _memberService.GetAll(pageIndex, pageSize, out total, "LoginName", Direction.Ascending, true, null, nodeType).ToArray(); + members = _memberService.GetAll(pageIndex, pageSize, out total).ToArray(); IndexItems(GetValueSets(members)); @@ -148,19 +166,6 @@ namespace UmbracoExamine } while (members.Length == pageSize); } } - else - { - //no node types specified, do all members - do - { - long total; - members = _memberService.GetAll(pageIndex, pageSize, out total).ToArray(); - - IndexItems(GetValueSets(members)); - - pageIndex++; - } while (members.Length == pageSize); - } } private IEnumerable GetValueSets(IEnumerable member)