Merge pull request #7639 from emmagarland/netcore/feature/7369-removeservices-unittests

Replaced instances of Current.Services.MediaService in more Unit Tests
This commit is contained in:
Bjarke Berg
2020-02-20 08:31:34 +01:00
committed by GitHub
2 changed files with 2 additions and 2 deletions

View File

@@ -99,7 +99,7 @@ namespace Umbraco.Tests.Cache.PublishedCache
//var publishedMedia = PublishedMediaTests.GetNode(mRoot.Id, GetUmbracoContext("/test", 1234));
var umbracoContext = GetUmbracoContext("/test");
var cache = new PublishedMediaCache(new XmlStore((XmlDocument)null, null, null, null, HostingEnvironment), Current.Services.MediaService, Current.Services.UserService, new DictionaryAppCache(), ContentTypesCache, Factory.GetInstance<IEntityXmlSerializer>(), Factory.GetInstance<IUmbracoContextAccessor>(), VariationContextAccessor);
var cache = new PublishedMediaCache(new XmlStore((XmlDocument)null, null, null, null, HostingEnvironment), ServiceContext.MediaService, ServiceContext.UserService, new DictionaryAppCache(), ContentTypesCache, Factory.GetInstance<IEntityXmlSerializer>(), Factory.GetInstance<IUmbracoContextAccessor>(), VariationContextAccessor);
var publishedMedia = cache.GetById(mRoot.Id);
Assert.IsNotNull(publishedMedia);

View File

@@ -545,7 +545,7 @@ namespace Umbraco.Tests.LegacyXmlPublishedCache
// was library.GetMedia which had its own cache, but MediaService *also* caches
// so, library.GetMedia is gone and now we directly work with MediaService
// (code below copied from what library was doing)
var media = Current.Services.MediaService.GetById(parentId);
var media = _mediaService.GetById(parentId);
if (media == null)
{
return Enumerable.Empty<IPublishedContent>();