diff --git a/src/Umbraco.Tests.Integration/Testing/IntegrationTestComposer.cs b/src/Umbraco.Tests.Integration/Testing/IntegrationTestComposer.cs index ebbfb0be25..ce0261febf 100644 --- a/src/Umbraco.Tests.Integration/Testing/IntegrationTestComposer.cs +++ b/src/Umbraco.Tests.Integration/Testing/IntegrationTestComposer.cs @@ -1,6 +1,7 @@ using Moq; using NUnit.Framework; using System; +using System.Collections.Generic; using System.IO; using System.Linq; using Microsoft.Extensions.Options; @@ -14,6 +15,7 @@ using Umbraco.Core.IO; using Umbraco.Core.Logging; using Umbraco.Core.Services; using Umbraco.Core.Services.Implement; +using Umbraco.Core.Sync; using Umbraco.Core.WebAssets; using Umbraco.Examine; using Umbraco.Web.Compose; @@ -50,6 +52,10 @@ namespace Umbraco.Tests.Integration.Testing // replace this service so that it can lookup the correct file locations composition.RegisterUnique(GetLocalizedTextService); + + composition.RegisterUnique(); + + } /// @@ -100,5 +106,51 @@ namespace Umbraco.Tests.Integration.Testing } } + private class NoopServerMessenger : IServerMessenger + { + public NoopServerMessenger() + { } + + public void PerformRefresh(ICacheRefresher refresher, TPayload[] payload) + { + + } + + public void PerformRefresh(ICacheRefresher refresher, Func getNumericId, params T[] instances) + { + + } + + public void PerformRefresh(ICacheRefresher refresher, Func getGuidId, params T[] instances) + { + + } + + public void PerformRemove(ICacheRefresher refresher, Func getNumericId, params T[] instances) + { + + } + + public void PerformRemove(ICacheRefresher refresher, params int[] numericIds) + { + + } + + public void PerformRefresh(ICacheRefresher refresher, params int[] numericIds) + { + + } + + public void PerformRefresh(ICacheRefresher refresher, params Guid[] guidIds) + { + + } + + public void PerformRefreshAll(ICacheRefresher refresher) + { + + } + } + } } diff --git a/src/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs b/src/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs index 18a9dfed89..fb57a543ac 100644 --- a/src/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs +++ b/src/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs @@ -247,11 +247,12 @@ namespace Umbraco.Tests.Integration.Testing CustomTestSetup(services); } + public virtual void Configure(IApplicationBuilder app) { Services.GetRequiredService().EnsureBackofficeSecurity(); Services.GetRequiredService().EnsureUmbracoContext(); - + // get the currently set ptions var testOptions = TestOptionAttributeBase.GetTestOptions(); if (testOptions.Boot) @@ -261,7 +262,7 @@ namespace Umbraco.Tests.Integration.Testing } #endregion - + #region LocalDb @@ -349,10 +350,6 @@ namespace Umbraco.Tests.Integration.Testing OnTestTearDown(() => { db.Detach(newSchemaDbId); - var caches = GetRequiredService(); - caches.IsolatedCaches.ClearAllCaches(); - caches.RuntimeCache.Clear(); - caches.RequestCache.Clear(); }); // We must re-configure our current factory since attaching a new LocalDb from the pool changes connection strings @@ -391,10 +388,6 @@ namespace Umbraco.Tests.Integration.Testing OnFixtureTearDown(() => { db.Detach(newSchemaFixtureDbId); - var caches = GetRequiredService(); - caches.IsolatedCaches.ClearAllCaches(); - caches.RuntimeCache.Clear(); - caches.RequestCache.Clear(); }); }