Post merge fixes

This commit is contained in:
Bjarke Berg
2023-12-13 15:47:35 +01:00
parent 95094361cc
commit f8dda5a7b5
10 changed files with 72 additions and 88 deletions

View File

@@ -1,4 +1,4 @@
using System.Linq;
using System.Linq;
using Microsoft.Extensions.Logging;
using Moq;
using NUnit.Framework;
@@ -35,10 +35,10 @@ public class DataValueEditorReuseTests
_dataValueEditorFactoryMock
.Setup(m =>
m.Create<BlockListPropertyEditorBase.BlockListEditorPropertyValueEditor>(It.IsAny<DataEditorAttribute>(), It.IsAny<BlockEditorDataConverter>()))
m.Create<BlockListPropertyEditorBase.BlockListEditorPropertyValueEditor>(It.IsAny<DataEditorAttribute>(), It.IsAny<BlockEditorDataConverter<BlockListValue, BlockListLayoutItem>>()))
.Returns(() => new BlockListPropertyEditorBase.BlockListEditorPropertyValueEditor(
new DataEditorAttribute("a", "b", "c"),
new BlockListEditorDataConverter(),
new BlockListEditorDataConverter(Mock.Of<IJsonSerializer>()),
_propertyEditorCollection,
Mock.Of<IDataTypeService>(),
Mock.Of<IContentTypeService>(),
@@ -98,7 +98,8 @@ public class DataValueEditorReuseTests
new PropertyEditorCollection(new DataEditorCollection(Enumerable.Empty<IDataEditor>)),
Mock.Of<IIOHelper>(),
Mock.Of<IEditorConfigurationParser>(),
Mock.Of<IBlockValuePropertyIndexValueFactory>());
Mock.Of<IBlockValuePropertyIndexValueFactory>(),
Mock.Of<IJsonSerializer>());
// block list is *not* set to reuse its data value editor
var dataValueEditor1 = blockListPropertyEditor.GetValueEditor();
@@ -107,7 +108,7 @@ public class DataValueEditorReuseTests
Assert.NotNull(dataValueEditor2);
Assert.AreNotSame(dataValueEditor1, dataValueEditor2);
_dataValueEditorFactoryMock.Verify(
m => m.Create<BlockListPropertyEditorBase.BlockListEditorPropertyValueEditor>(It.IsAny<DataEditorAttribute>(), It.IsAny<BlockEditorDataConverter>()),
m => m.Create<BlockListPropertyEditorBase.BlockListEditorPropertyValueEditor>(It.IsAny<DataEditorAttribute>(), It.IsAny<BlockEditorDataConverter<BlockListValue, BlockListLayoutItem>>()),
Times.Exactly(2));
}
@@ -119,7 +120,8 @@ public class DataValueEditorReuseTests
new PropertyEditorCollection(new DataEditorCollection(Enumerable.Empty<IDataEditor>)),
Mock.Of<IIOHelper>(),
Mock.Of<IEditorConfigurationParser>(),
Mock.Of<IBlockValuePropertyIndexValueFactory>());
Mock.Of<IBlockValuePropertyIndexValueFactory>(),
Mock.Of<IJsonSerializer>());
// no matter what, a property editor should never reuse its data value editor when created *with* configuration
var dataValueEditor1 = blockListPropertyEditor.GetValueEditor("config");
@@ -130,7 +132,7 @@ public class DataValueEditorReuseTests
Assert.AreEqual("config", ((DataValueEditor)dataValueEditor2).ConfigurationObject);
Assert.AreNotSame(dataValueEditor1, dataValueEditor2);
_dataValueEditorFactoryMock.Verify(
m => m.Create<BlockListPropertyEditorBase.BlockListEditorPropertyValueEditor>(It.IsAny<DataEditorAttribute>(), It.IsAny<BlockEditorDataConverter>()),
m => m.Create<BlockListPropertyEditorBase.BlockListEditorPropertyValueEditor>(It.IsAny<DataEditorAttribute>(), It.IsAny<BlockEditorDataConverter<BlockListValue, BlockListLayoutItem>>()),
Times.Exactly(2));
}
}