public void GetNameAndAddSuffixTest() { Type t = typeof(A <,>); string fName = t.GetFullName(); Assert.AreEqual(t.Namespace + ".A<,>", fName); string sName = t.GetShortName(); Assert.AreEqual("A<,>", sName); string wsName = TypeHelper.AddSuffix(fName, "#"); Assert.AreEqual(t.Namespace + ".A#<,>", wsName); fName = t.FullName; wsName = TypeHelper.AddSuffix(fName, "#"); Assert.AreEqual(t.Namespace + ".A#`2", wsName); t = typeof(A <int, string>); fName = t.GetFullName(); Assert.AreEqual(t.Namespace + ".A<System.Int32,System.String>", fName); sName = t.GetShortName(); Assert.AreEqual("A<Int32,String>", sName); wsName = TypeHelper.AddSuffix(fName, "#"); Assert.AreEqual(t.Namespace + ".A#<System.Int32,System.String>", wsName); fName = t.FullName; wsName = TypeHelper.AddSuffix(fName, "#"); AssertEx.IsPatternMatch(wsName, t.Namespace + ".A#`2[[*]]"); t = typeof(A <int, string> .B <bool>); fName = t.GetFullName(); Assert.AreEqual(t.Namespace + ".A<System.Int32,System.String>+B<System.Boolean>", fName); sName = t.GetShortName(); Assert.AreEqual("A<Int32,String>+B<Boolean>", sName); t = t.GetGenericTypeDefinition().GetGenericArguments()[2]; fName = t.GetFullName(); Assert.AreEqual("T3", fName); sName = t.GetShortName(); Assert.AreEqual("T3", sName); }