DataTypes refactoring - troubleshooting

This commit is contained in:
Stephan
2018-02-08 16:08:52 +01:00
parent 450854a209
commit c0439b3c4e
37 changed files with 493 additions and 315 deletions

View File

@@ -6,6 +6,10 @@ using Umbraco.Core.PropertyEditors.ValueConverters;
using Umbraco.Tests.TestHelpers;
using LightInject;
using Moq;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.Services;
using Umbraco.Web.PropertyEditors;
namespace Umbraco.Tests.PublishedContent
{
@@ -35,13 +39,17 @@ namespace Umbraco.Tests.PublishedContent
base.Initialize();
var converters = Container.GetInstance<PropertyValueConverterCollection>();
var publishedContentTypeFactory = new PublishedContentTypeFactory(Mock.Of<IPublishedModelFactory>(), converters, Mock.Of<IDataTypeConfigurationSource>());
var dataTypeService = new TestObjects.TestDataTypeService(
new DataType(new RichTextPropertyEditor(Mock.Of<ILogger>())) { Id = 1 });
var publishedContentTypeFactory = new PublishedContentTypeFactory(Mock.Of<IPublishedModelFactory>(), converters, dataTypeService);
// need to specify a custom callback for unit tests
var propertyTypes = new[]
{
// AutoPublishedContentType will auto-generate other properties
publishedContentTypeFactory.CreatePropertyType("content", 0, Constants.PropertyEditors.Aliases.TinyMce),
publishedContentTypeFactory.CreatePropertyType("content", 1),
};
var type = new AutoPublishedContentType(0, "anything", propertyTypes);
ContentTypesCache.GetPublishedContentTypeByAlias = alias => type;