当前位置: 首页>>代码示例>>C#>>正文


C# TestEnvironment.MakeEntryWithLexemeForm方法代码示例

本文整理汇总了C#中TestEnvironment.MakeEntryWithLexemeForm方法的典型用法代码示例。如果您正苦于以下问题:C# TestEnvironment.MakeEntryWithLexemeForm方法的具体用法?C# TestEnvironment.MakeEntryWithLexemeForm怎么用?C# TestEnvironment.MakeEntryWithLexemeForm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TestEnvironment的用法示例。


在下文中一共展示了TestEnvironment.MakeEntryWithLexemeForm方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetHomographNumber_3SameLexicalFormsAnd3OtherLexicalForms_Returns123

		public void GetHomographNumber_3SameLexicalFormsAnd3OtherLexicalForms_Returns123()
		{
			using (var env = new TestEnvironment())
			{
				LexEntry red1 = env.MakeEntryWithLexemeForm(env.HeadwordWritingSystem.LanguageTag, "red");
				LexEntry blue1 = env.MakeEntryWithLexemeForm(env.HeadwordWritingSystem.LanguageTag, "blue");
				LexEntry red2 = env.MakeEntryWithLexemeForm(env.HeadwordWritingSystem.LanguageTag, "red");
				LexEntry blue2 = env.MakeEntryWithLexemeForm(env.HeadwordWritingSystem.LanguageTag, "blue");
				LexEntry red3 = env.MakeEntryWithLexemeForm(env.HeadwordWritingSystem.LanguageTag, "red");
				LexEntry blue3 = env.MakeEntryWithLexemeForm(env.HeadwordWritingSystem.LanguageTag, "blue");
				Assert.AreEqual(1, env.Repository.GetHomographNumber(blue1, env.HeadwordWritingSystem));
				Assert.AreEqual(3, env.Repository.GetHomographNumber(blue3, env.HeadwordWritingSystem));
				Assert.AreEqual(2, env.Repository.GetHomographNumber(blue2, env.HeadwordWritingSystem));
				Assert.AreEqual(1, env.Repository.GetHomographNumber(red1, env.HeadwordWritingSystem));
				Assert.AreEqual(3, env.Repository.GetHomographNumber(red3, env.HeadwordWritingSystem));
				Assert.AreEqual(2, env.Repository.GetHomographNumber(red2, env.HeadwordWritingSystem));
			}
		}
开发者ID:jwickberg,项目名称:libpalaso,代码行数:18,代码来源:LexEntryRepositoryTests.cs

示例2: GetHomographNumber_3SameLexicalForms_Returns123

		public void GetHomographNumber_3SameLexicalForms_Returns123()
		{
			using (var env = new TestEnvironment())
			{
				LexEntry entry1 = env.MakeEntryWithLexemeForm(env.HeadwordWritingSystem.LanguageTag, "blue");
				LexEntry entry2 = env.MakeEntryWithLexemeForm(env.HeadwordWritingSystem.LanguageTag, "blue");
				LexEntry entry3 = env.MakeEntryWithLexemeForm(env.HeadwordWritingSystem.LanguageTag, "blue");
				Assert.AreEqual(1,
					env.Repository.GetHomographNumber(entry1, env.HeadwordWritingSystem));
				Assert.AreEqual(3,
					env.Repository.GetHomographNumber(entry3, env.HeadwordWritingSystem));
				Assert.AreEqual(2,
					env.Repository.GetHomographNumber(entry2, env.HeadwordWritingSystem));
			}
		}
开发者ID:jwickberg,项目名称:libpalaso,代码行数:15,代码来源:LexEntryRepositoryTests.cs

示例3: GetHomographNumber_ThirdEntry_Returns3

		public void GetHomographNumber_ThirdEntry_Returns3()
		{
			using (var env = new TestEnvironment())
			{
				LexEntry entryOther = env.MakeEntryWithLexemeForm("en", "blue");
				Assert.AreNotEqual("en", env.HeadwordWritingSystem.LanguageTag);
				LexEntry entry1 = env.MakeEntryWithLexemeForm(env.HeadwordWritingSystem.LanguageTag, "blue");
				LexEntry entry2 = env.MakeEntryWithLexemeForm(env.HeadwordWritingSystem.LanguageTag, "blue");
				LexEntry entry3 = env.MakeEntryWithLexemeForm(env.HeadwordWritingSystem.LanguageTag, "blue");
				Assert.AreEqual(3,
					env.Repository.GetHomographNumber(entry3, env.HeadwordWritingSystem));
				Assert.AreEqual(2,
					env.Repository.GetHomographNumber(entry2, env.HeadwordWritingSystem));
				Assert.AreEqual(1,
					env.Repository.GetHomographNumber(entry1, env.HeadwordWritingSystem));
			}
		}
开发者ID:jwickberg,项目名称:libpalaso,代码行数:17,代码来源:LexEntryRepositoryTests.cs

示例4: GetHomographNumber_AssignesUniqueNumbers

		public void GetHomographNumber_AssignesUniqueNumbers()
		{
			using (var env = new TestEnvironment())
			{
				LexEntry entryOther = env.MakeEntryWithLexemeForm("en", "blue");
				Assert.AreNotEqual("en", env.HeadwordWritingSystem.LanguageTag);
				LexEntry[] entries = new LexEntry[3];
				entries[0] = env.MakeEntryWithLexemeForm(env.HeadwordWritingSystem.LanguageTag, "blue");
				entries[1] = env.MakeEntryWithLexemeForm(env.HeadwordWritingSystem.LanguageTag, "blue");
				entries[2] = env.MakeEntryWithLexemeForm(env.HeadwordWritingSystem.LanguageTag, "blue");
				List<int> ids = new List<int>(entries.Length);
				foreach (LexEntry entry in entries)
				{
					int homographNumber = env.Repository.GetHomographNumber(entry,
						env.HeadwordWritingSystem);
					Assert.IsFalse(ids.Contains(homographNumber));
					ids.Add(homographNumber);
				}
			}
		}
开发者ID:jwickberg,项目名称:libpalaso,代码行数:20,代码来源:LexEntryRepositoryTests.cs

示例5: GetHomographNumber_SecondEntry_Returns2

		public void GetHomographNumber_SecondEntry_Returns2()
		{
			using (var env = new TestEnvironment())
			{
				env.MakeEntryWithLexemeForm(env.HeadwordWritingSystem.LanguageTag, "blue");
				LexEntry entry2 = env.MakeEntryWithLexemeForm(env.HeadwordWritingSystem.LanguageTag, "blue");
				Assert.AreEqual(2,
					env.Repository.GetHomographNumber(entry2, env.HeadwordWritingSystem));
			}
		}
开发者ID:jwickberg,项目名称:libpalaso,代码行数:10,代码来源:LexEntryRepositoryTests.cs

示例6: GetHomographNumber_FirstEntryWithFollowingHomograph_Returns1

		public void GetHomographNumber_FirstEntryWithFollowingHomograph_Returns1()
		{
			using (var env = new TestEnvironment())
			{
				LexEntry entry1 = env.MakeEntryWithLexemeForm(env.HeadwordWritingSystem.LanguageTag, "blue");
				env.MakeEntryWithLexemeForm(env.HeadwordWritingSystem.LanguageTag, "blue");
				Assert.AreEqual(1,
					env.Repository.GetHomographNumber(entry1, env.HeadwordWritingSystem));
			}
		}
开发者ID:jwickberg,项目名称:libpalaso,代码行数:10,代码来源:LexEntryRepositoryTests.cs


注:本文中的TestEnvironment.MakeEntryWithLexemeForm方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。