Refactor editing, all tests green

This commit is contained in:
Stephan
2018-02-16 12:00:45 +01:00
parent cfd2ba3b5a
commit 47d7677948
39 changed files with 465 additions and 477 deletions

View File

@@ -31,7 +31,7 @@ namespace Umbraco.Tests.Models.Mapping
Container.Register(_ => manifestBuilder);
Func<IEnumerable<Type>> typeListProducerList = Enumerable.Empty<Type>;
Container.GetInstance<PropertyEditorCollectionBuilder>()
Container.GetInstance<DataEditorCollectionBuilder>()
.Clear()
.Add(typeListProducerList);
}

View File

@@ -72,7 +72,8 @@ namespace Umbraco.Tests.Models.Mapping
// create and register a fake property editor collection to return fake property editors
var editors = new ConfiguredDataEditor[] { new TextboxPropertyEditor(Mock.Of<ILogger>()), };
_editorsMock = new Mock<PropertyEditorCollection>(new object[] { editors });
var dataEditors = new DataEditorCollection(editors);
_editorsMock = new Mock<PropertyEditorCollection>(dataEditors);
_editorsMock.Setup(x => x[It.IsAny<string>()]).Returns(editors[0]);
Container.RegisterSingleton(f => _editorsMock.Object);

View File

@@ -29,7 +29,7 @@ namespace Umbraco.Tests.Models.Mapping
Container.RegisterSingleton(f => Mock.Of<ICultureDictionaryFactory>());
}
[ValueEditor("Test.Test", "Test", "~/Test.html")]
[DataEditor("Test.Test", "Test", "~/Test.html")]
public class TestPropertyEditor : ConfiguredDataEditor
{
/// <summary>