Example #1
0
 static void BlendCore(params string[] strs)
 {
     foreach (var item in strs)
     {
         var pinyinStr = Pinyin.GetPinyin(item, PinyinFormat.UpperVerticalBar);
         TestContext.WriteLine(pinyinStr);
     }
 }
Example #2
0
        public void Full()
        {
            const string testStr   = "长沙";
            var          pinyinStr = "CHANG" + Pinyin.SeparatorVerticalBar + "SHA";

            // testStr 值如果有多音字可能导致测试不通过
            foreach (var item in testStr)
            {
                Assert.IsTrue(Pinyin.IsChinese(item));
            }
            var pinyinStr2 = Pinyin.GetPinyin(testStr, PinyinFormat.UpperVerticalBar);

            Assert.IsTrue(pinyinStr == pinyinStr2);
        }