-Added TypeNameAssemblyFormatHandling

-Added TypeNameAssemblyFormatHandling properties to JsonSerializer and JsonSerializerSettings
-Changed TypeNameAssemblyFormat properties on JsonSerializer and JsonSerializerSettings to obsolete
This commit is contained in:
James Newton-King
2016-09-17 15:57:03 +12:00
parent a0403492ad
commit ca27a0fc3a
17 changed files with 184 additions and 33 deletions
@@ -50,16 +50,16 @@ namespace Newtonsoft.Json.Tests.Utilities
{
string typeName;
typeName = ReflectionUtils.GetTypeName(typeof(IList<Type>), FormatterAssemblyStyle.Simple, null);
typeName = ReflectionUtils.GetTypeName(typeof(IList<Type>), TypeNameAssemblyFormatHandling.Simple, null);
Assert.AreEqual("System.Collections.Generic.IList`1[[System.Type, mscorlib]], mscorlib", typeName);
typeName = ReflectionUtils.GetTypeName(typeof(IDictionary<IList<Type>, IList<Type>>), FormatterAssemblyStyle.Simple, null);
typeName = ReflectionUtils.GetTypeName(typeof(IDictionary<IList<Type>, IList<Type>>), TypeNameAssemblyFormatHandling.Simple, null);
Assert.AreEqual("System.Collections.Generic.IDictionary`2[[System.Collections.Generic.IList`1[[System.Type, mscorlib]], mscorlib],[System.Collections.Generic.IList`1[[System.Type, mscorlib]], mscorlib]], mscorlib", typeName);
typeName = ReflectionUtils.GetTypeName(typeof(IList<>), FormatterAssemblyStyle.Simple, null);
typeName = ReflectionUtils.GetTypeName(typeof(IList<>), TypeNameAssemblyFormatHandling.Simple, null);
Assert.AreEqual("System.Collections.Generic.IList`1, mscorlib", typeName);
typeName = ReflectionUtils.GetTypeName(typeof(IDictionary<,>), FormatterAssemblyStyle.Simple, null);
typeName = ReflectionUtils.GetTypeName(typeof(IDictionary<,>), TypeNameAssemblyFormatHandling.Simple, null);
Assert.AreEqual("System.Collections.Generic.IDictionary`2, mscorlib", typeName);
}
}