⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testpyspell.cs

📁 可以将汉字转换成拼音
💻 CS
字号:
using System;
using Sunrise.Spell;
using NUnit.Framework;

namespace Test
{
	/// <summary>
	/// TestPYSpell 的摘要说明。
	/// </summary>
	[TestFixture]
	public class TestPYSpell
	{
		public TestPYSpell()
		{
		}

		[Test]
		public void TestFirstLetterOnly()
		{
			string strChinese = "一只棕色狐狸跳过那只狗";
			string expect = "YZZSHLTGNZG";

			string result = Spell.MakeSpellCode(strChinese, SpellOptions.FirstLetterOnly);

			Assert.AreEqual(expect, result);
		}

		[Test]
		public void TestFullTranslation()
		{
			string strChinese = "一只棕色狐狸跳过那只狗";
			string expect = "YIZHIZONGSEHULITIAOGUONAZHIGOU";

			string result = Spell.MakeSpellCode(strChinese, SpellOptions.EnableUnicodeLetter);

			Assert.AreEqual(expect, result);
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -