Introduce IUmbracoContextFactory

This commit is contained in:
Stephan
2019-02-14 12:11:06 +01:00
parent e5142e4915
commit 186e8fc58b
20 changed files with 285 additions and 249 deletions

View File

@@ -5,11 +5,14 @@ using Moq;
using NUnit.Framework;
using Umbraco.Core.Components;
using Umbraco.Core.Composing;
using Umbraco.Core.Configuration.UmbracoSettings;
using Umbraco.Core.Events;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Membership;
using Umbraco.Core.Services;
using Umbraco.Tests.Testing;
using Umbraco.Tests.Testing.Objects.Accessors;
using Umbraco.Web;
using Umbraco.Web.Cache;
using Umbraco.Web.PublishedCache;
using Umbraco.Web.Routing;
@@ -149,8 +152,18 @@ namespace Umbraco.Tests.Cache
};
var umbracoContextFactory = new UmbracoContextFactory(
new TestUmbracoContextAccessor(),
Mock.Of<IPublishedSnapshotService>(),
new TestVariationContextAccessor(),
new TestDefaultCultureAccessor(),
TestObjects.GetUmbracoSettings(),
TestObjects.GetGlobalSettings(),
Enumerable.Empty<IUrlProvider>(),
Mock.Of<IUserService>());
// just assert it does not throw
var refreshers = new DistributedCacheBinder(null, null);
var refreshers = new DistributedCacheBinder(null, umbracoContextFactory, null);
refreshers.HandleEvents(definitions);
}
}