Replaced instances of MediaService with ServiceContext or existing injected mediaservice

This commit is contained in:
Emma Garland
2020-02-11 10:23:28 +00:00
parent b850b3c8fe
commit 7afcbd5ec3
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>();