diff --git a/Tests/ResxDataNodeTests.cs b/Tests/ResxDataNodeTests.cs index b693d9c..aa5cbe4 100644 --- a/Tests/ResxDataNodeTests.cs +++ b/Tests/ResxDataNodeTests.cs @@ -126,5 +126,34 @@ public void ResxDataNode_ResXFileRefsWrittenBackWithSameAssemblyInfo() Assert.Equal(originalResx, writerOutput.ToString()); } + + [Fact] + public void ResxDataNode_CustomTypeConvertersDontOverwriteDefaultConverters() + { + string expectedIntTypeName = "some-text"; + string customTypeConverter(Type type) + { + if (type == typeof(int)) return expectedIntTypeName; + else return null; + } + + var intNode = new ResXDataNode("int-node", 1, customTypeConverter); + + var fileRefNode = new ResXDataNode("file-node", new ResXFileRef("i-am-file.txt", typeof(string).AssemblyQualifiedName), customTypeConverter); + + + var expected = + ( + ("int-node", expectedIntTypeName), + ("file-node", NetStandard.ResXConstants.ResxFileRefTypeInfo) + ); + var actual = + ( + ("int-node", intNode.GetDataNodeInfo().TypeName), + ("file-node", fileRefNode.GetDataNodeInfo().TypeName) + ); + + Assert.Equal(expected, actual); + } } }