2 using System.Collections.Generic;
4 using System.Runtime.Serialization.Formatters;
7 using Newtonsoft.Json.Utilities;
9 namespace Newtonsoft.Json.Tests.Utilities
11 public class ReflectionUtilsTests : TestFixtureBase
14 public void GetTypeNameSimpleForGenericTypes()
18 typeName = ReflectionUtils.GetTypeName(typeof(IList<Type>), FormatterAssemblyStyle.Simple);
19 Assert.AreEqual("System.Collections.Generic.IList`1[[System.Type, mscorlib]], mscorlib", typeName);
21 typeName = ReflectionUtils.GetTypeName(typeof(IDictionary<IList<Type>, IList<Type>>), FormatterAssemblyStyle.Simple);
22 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);
24 typeName = ReflectionUtils.GetTypeName(typeof(IList<>), FormatterAssemblyStyle.Simple);
25 Assert.AreEqual("System.Collections.Generic.IList`1, mscorlib", typeName);
27 typeName = ReflectionUtils.GetTypeName(typeof(IDictionary<,>), FormatterAssemblyStyle.Simple);
28 Assert.AreEqual("System.Collections.Generic.IDictionary`2, mscorlib", typeName);