Provides an abstraction for creating the JavaScriptEncoder used in SystemTextConfigurationEditorJsonSerializer (#19849)
* Provides an abstraction for creating the JavaScriptEncoder used in SystemTextConfigurationEditorJsonSerializer. * Generalised JSON serialization encoder factory to work for all System.Tex.Json serializers. Added the serializer's name as a parameter to allow for different encodings per serializer if required. * Fixed tests by removing use of obsolete constructors. * Removed name parameter and used a generic type instead.
This commit is contained in:
@@ -28,7 +28,7 @@ public class PropertyCacheLevelTests
|
||||
|
||||
var converters = new PropertyValueConverterCollection(() => new IPropertyValueConverter[] { converter });
|
||||
|
||||
var configurationEditorJsonSerializer = new SystemTextConfigurationEditorJsonSerializer();
|
||||
var configurationEditorJsonSerializer = new SystemTextConfigurationEditorJsonSerializer(new DefaultJsonSerializerEncoderFactory());
|
||||
var dataTypeServiceMock = new Mock<IDataTypeService>();
|
||||
var dataType = new DataType(
|
||||
new VoidEditor(Mock.Of<IDataValueEditorFactory>()), configurationEditorJsonSerializer)
|
||||
@@ -103,7 +103,7 @@ public class PropertyCacheLevelTests
|
||||
|
||||
var dataTypeServiceMock = new Mock<IDataTypeService>();
|
||||
var dataType = new DataType(
|
||||
new VoidEditor(Mock.Of<IDataValueEditorFactory>()), new SystemTextConfigurationEditorJsonSerializer())
|
||||
new VoidEditor(Mock.Of<IDataValueEditorFactory>()), new SystemTextConfigurationEditorJsonSerializer(new DefaultJsonSerializerEncoderFactory()))
|
||||
{ Id = 1 };
|
||||
dataTypeServiceMock.Setup(x => x.GetAll()).Returns(dataType.Yield);
|
||||
|
||||
@@ -171,7 +171,7 @@ public class PropertyCacheLevelTests
|
||||
|
||||
var dataTypeServiceMock = new Mock<IDataTypeService>();
|
||||
var dataType = new DataType(
|
||||
new VoidEditor(Mock.Of<IDataValueEditorFactory>()), new SystemTextConfigurationEditorJsonSerializer())
|
||||
new VoidEditor(Mock.Of<IDataValueEditorFactory>()), new SystemTextConfigurationEditorJsonSerializer(new DefaultJsonSerializerEncoderFactory()))
|
||||
{ Id = 1 };
|
||||
dataTypeServiceMock.Setup(x => x.GetAll()).Returns(dataType.Yield);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user