Replaced member service and user service with mocks

This commit is contained in:
Emma Garland
2020-01-31 13:51:22 +00:00
parent 5259b19eef
commit 8cb11de18c
@@ -4,7 +4,6 @@ using Moq;
using NUnit.Framework;
using Umbraco.Core;
using Umbraco.Core.Cache;
using Umbraco.Web.Composing;
using Umbraco.Core.Configuration;
using Umbraco.Core.Configuration.UmbracoSettings;
using Umbraco.Core.Services;
@@ -70,7 +69,7 @@ namespace Umbraco.Tests.Cache.PublishedCache
var publishedShapshot = new PublishedSnapshot(
new PublishedContentCache(xmlStore, domainCache, appCache, globalSettings, ContentTypesCache, null, VariationContextAccessor, null),
new PublishedMediaCache(xmlStore, ServiceContext.MediaService, ServiceContext.UserService, appCache, ContentTypesCache, Factory.GetInstance<IEntityXmlSerializer>(), umbracoContextAccessor, VariationContextAccessor),
new PublishedMemberCache(null, appCache, Current.Services.MemberService, ContentTypesCache, Current.Services.UserService, VariationContextAccessor),
new PublishedMemberCache(null, appCache, Mock.Of<IMemberService>(), ContentTypesCache, Mock.Of<IUserService>(), VariationContextAccessor),
domainCache);
var publishedSnapshotService = new Mock<IPublishedSnapshotService>();
publishedSnapshotService.Setup(x => x.CreatePublishedSnapshot(It.IsAny<string>())).Returns(publishedShapshot);
@@ -78,7 +77,7 @@ namespace Umbraco.Tests.Cache.PublishedCache
_umbracoContext = new UmbracoContext(
_httpContextFactory.HttpContext,
publishedSnapshotService.Object,
new WebSecurity(_httpContextFactory.HttpContext, Current.Services.UserService, globalSettings),
new WebSecurity(_httpContextFactory.HttpContext, Mock.Of<IUserService>(), globalSettings),
umbracoSettings,
Enumerable.Empty<IUrlProvider>(),
Enumerable.Empty<IMediaUrlProvider>(),