@@ -65,10 +65,17 @@ public void DisplayTextTest()
6565 }
6666
6767 private static void AssertChar ( int codePoint , UnicodeCategory category , string name , string block )
68+ {
69+ AssertChar ( codePoint , category , UnicodeNumericType . None , null , name , block ) ;
70+ }
71+
72+ private static void AssertChar ( int codePoint , UnicodeCategory category , UnicodeNumericType numericType , UnicodeRationalNumber ? numericValue , string name , string block )
6873 {
6974 var info = UnicodeInfo . GetCharInfo ( codePoint ) ;
7075 Assert . AreEqual ( codePoint , info . CodePoint ) ;
7176 Assert . AreEqual ( category , info . Category ) ;
77+ Assert . AreEqual ( numericType , info . NumericType ) ;
78+ Assert . AreEqual ( numericValue , info . NumericValue ) ;
7279 Assert . AreEqual ( name , info . Name ) ;
7380 Assert . AreEqual ( block , UnicodeInfo . GetBlockName ( codePoint ) ) ;
7481 Assert . AreEqual ( block , info . Block ) ;
@@ -77,6 +84,11 @@ private static void AssertChar(int codePoint, UnicodeCategory category, string n
7784 [ TestMethod ]
7885 public void CharacterInfoTest ( )
7986 {
87+ AssertChar ( 0x0030 , UnicodeCategory . DecimalDigitNumber , UnicodeNumericType . Decimal , new UnicodeRationalNumber ( 0 ) , "DIGIT ZERO" , "Basic Latin" ) ;
88+ AssertChar ( 0x0031 , UnicodeCategory . DecimalDigitNumber , UnicodeNumericType . Decimal , new UnicodeRationalNumber ( 1 ) , "DIGIT ONE" , "Basic Latin" ) ;
89+ AssertChar ( 0x0032 , UnicodeCategory . DecimalDigitNumber , UnicodeNumericType . Decimal , new UnicodeRationalNumber ( 2 ) , "DIGIT TWO" , "Basic Latin" ) ;
90+ AssertChar ( 0x0035 , UnicodeCategory . DecimalDigitNumber , UnicodeNumericType . Decimal , new UnicodeRationalNumber ( 5 ) , "DIGIT FIVE" , "Basic Latin" ) ;
91+ AssertChar ( 0x0039 , UnicodeCategory . DecimalDigitNumber , UnicodeNumericType . Decimal , new UnicodeRationalNumber ( 9 ) , "DIGIT NINE" , "Basic Latin" ) ;
8092 AssertChar ( 0x0041 , UnicodeCategory . UppercaseLetter , "LATIN CAPITAL LETTER A" , "Basic Latin" ) ;
8193 AssertChar ( 0x1F600 , UnicodeCategory . OtherSymbol , "GRINNING FACE" , "Emoticons" ) ;
8294 AssertChar ( 0x00E9 , UnicodeCategory . LowercaseLetter , "LATIN SMALL LETTER E WITH ACUTE" , "Latin-1 Supplement" ) ;
@@ -138,7 +150,10 @@ public void RationalNumberTest()
138150 [ TestMethod ]
139151 public void HangulNameTest ( )
140152 {
141- Assert . AreEqual ( "HANGUL SYLLABLE PWILH" , UnicodeInfo . GetName ( 0xD4DB ) ) ;
153+ AssertEx . ThrowsExactly < ArgumentOutOfRangeException > ( ( ) => HangulInfo . GetHangulName ( '\0 ' ) ) ;
154+ AssertEx . ThrowsExactly < ArgumentOutOfRangeException > ( ( ) => HangulInfo . GetHangulName ( '\uABFF ' ) ) ;
155+ AssertEx . ThrowsExactly < ArgumentOutOfRangeException > ( ( ) => HangulInfo . GetHangulName ( '\uD7A5 ' ) ) ;
156+ Assert . AreEqual ( "HANGUL SYLLABLE PWILH" , UnicodeInfo . GetName ( 0xD4DB ) ) ;
142157 Assert . AreEqual ( "HANGUL SYLLABLE PWAENG" , UnicodeInfo . GetName ( 0xD439 ) ) ;
143158 Assert . AreEqual ( "HANGUL SYLLABLE PANJ" , UnicodeInfo . GetName ( 0xD311 ) ) ;
144159 Assert . AreEqual ( "HANGUL SYLLABLE TOLM" , UnicodeInfo . GetName ( 0xD1AA ) ) ;
@@ -177,6 +192,7 @@ public void RadicalInfoTest()
177192 var radical1 = UnicodeInfo . GetCjkRadicalInfo ( 1 ) ;
178193
179194 Assert . AreEqual ( false , radical1 . HasSimplifiedForm ) ;
195+ Assert . AreEqual ( 1 , radical1 . RadicalIndex ) ;
180196 Assert . AreEqual ( '\u2F00 ' , radical1 . TraditionalRadicalCodePoint ) ;
181197 Assert . AreEqual ( '\u4E00 ' , radical1 . TraditionalCharacterCodePoint ) ;
182198 Assert . AreEqual ( '\u2F00 ' , radical1 . SimplifiedRadicalCodePoint ) ;
@@ -185,6 +201,7 @@ public void RadicalInfoTest()
185201 var radical214 = UnicodeInfo . GetCjkRadicalInfo ( 214 ) ;
186202
187203 Assert . AreEqual ( false , radical214 . HasSimplifiedForm ) ;
204+ Assert . AreEqual ( 214 , radical214 . RadicalIndex ) ;
188205 Assert . AreEqual ( '\u2FD5 ' , radical214 . TraditionalRadicalCodePoint ) ;
189206 Assert . AreEqual ( '\u9FA0 ' , radical214 . TraditionalCharacterCodePoint ) ;
190207 Assert . AreEqual ( '\u2FD5 ' , radical214 . SimplifiedRadicalCodePoint ) ;
0 commit comments