Fix tests

This commit is contained in:
Stephan
2018-06-29 14:25:48 +02:00
parent ce74108848
commit 8462c7efbb
4 changed files with 9 additions and 1 deletions

View File

@@ -30,7 +30,8 @@ namespace Umbraco.Core.IO
{
// due to how FileSystems is written at the moment, the ctor cannot be used to inject
// dependencies, so we have to rely on property injection for anything we might need
Current.Container.InjectProperties(this);
Current.Container.InjectProperties(this);
MediaPathScheme.Initialize(this);
UploadAutoFillProperties = new UploadAutoFillProperties(this, Logger, ContentConfig);
}

View File

@@ -8,6 +8,7 @@ using Umbraco.Core;
using Umbraco.Core.Configuration.UmbracoSettings;
using Umbraco.Core.Composing;
using Umbraco.Core.IO;
using Umbraco.Core.IO.MediaPathSchemes;
using Umbraco.Core.Logging;
using Umbraco.Core.Services;
using Umbraco.Tests.TestHelpers;
@@ -32,6 +33,7 @@ namespace Umbraco.Tests.IO
_container.Register<FileSystems>();
_container.Register(_ => Mock.Of<IDataTypeService>());
_container.Register(_ => Mock.Of<IContentSection>());
_container.RegisterSingleton<IMediaPathScheme, OriginalMediaPathScheme>();
// make sure we start clean
// because some tests will create corrupt or weird filesystems

View File

@@ -9,6 +9,7 @@ using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.Configuration.UmbracoSettings;
using Umbraco.Core.IO;
using Umbraco.Core.IO.MediaPathSchemes;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.Models.PublishedContent;
@@ -72,6 +73,7 @@ namespace Umbraco.Tests.PropertyEditors
container.Register<ILogger, PerContainerLifetime>(f => Mock.Of<ILogger>());
container.Register<IContentSection, PerContainerLifetime>(f => Mock.Of<IContentSection>());
container.RegisterSingleton<IMediaPathScheme, OriginalMediaPathScheme>();
var mediaFileSystem = new MediaFileSystem(Mock.Of<IFileSystem>());
var dataTypeService = new TestObjects.TestDataTypeService(

View File

@@ -15,6 +15,7 @@ using Umbraco.Core.Composing.CompositionRoots;
using Umbraco.Core.Configuration;
using Umbraco.Core.Events;
using Umbraco.Core.IO;
using Umbraco.Core.IO.MediaPathSchemes;
using Umbraco.Core.Logging;
using Umbraco.Core.Manifest;
using Umbraco.Core.Models.PublishedContent;
@@ -188,6 +189,8 @@ namespace Umbraco.Tests.Testing
Container.RegisterCollectionBuilder<PropertyValueConverterCollectionBuilder>();
Container.RegisterSingleton<IPublishedContentTypeFactory, PublishedContentTypeFactory>();
Container.RegisterSingleton<IMediaPathScheme, OriginalMediaPathScheme>();
}
protected virtual void ComposeCacheHelper()