本文整理汇总了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));
}
}
示例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));
}
}
示例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));
}
}
示例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);
}
}
}
示例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));
}
}
示例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));
}
}