testpyspell.cs

来自「最牛逼的可将中文加密后转换成英文字母的加密算法」· CS 代码 · 共 40 行

CS
40
字号
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 + =
减小字号Ctrl + -
显示快捷键?