Beispiel #1
0
        /// <summary>
        /// 判断拼音格式
        /// </summary>
        /// <param name="hanzi"></param>
        /// <param name="expected"></param>
        /// <param name="format"></param>
        private void PinyinFormatAssert(string hanzi, string expected, PinyinFormat format)
        {
            var fmted = Name4Net.GetPinyin(hanzi, format);

            Assert.AreEqual(expected, fmted);
        }
Beispiel #2
0
        /// <summary>
        /// 判断读音
        /// </summary>
        /// <param name="hanzi"></param>
        /// <param name="expected"></param>
        private void HanziAssert(string hanzi, string expected)
        {
            var actual = Name4Net.GetPinyin(hanzi);

            Assert.AreEqual(expected, actual);
        }