本文整理汇总了C#中TestEnvironment.CreateThreeDifferentLexEntries方法的典型用法代码示例。如果您正苦于以下问题:C# TestEnvironment.CreateThreeDifferentLexEntries方法的具体用法?C# TestEnvironment.CreateThreeDifferentLexEntries怎么用?C# TestEnvironment.CreateThreeDifferentLexEntries使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestEnvironment
的用法示例。
在下文中一共展示了TestEnvironment.CreateThreeDifferentLexEntries方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: using
public void GetEntriesWithSimilarLexicalForm_EntriesWithDifferingWritingSystems_OnlyFindEntriesMatchingTheGivenWritingSystem()
{
using (var env = new TestEnvironment())
{
env.CreateThreeDifferentLexEntries(delegate(LexEntry e) { return e.LexicalForm; });
LexEntry lexEntryWithFrenchLexicalForm = env.Repository.CreateItem();
lexEntryWithFrenchLexicalForm.LexicalForm.SetAlternative("fr", "de Word2");
var ws = WritingSystemDefinitionForTest("de");
var matches = env.Repository.GetEntriesWithSimilarLexicalForm(
"de Wor",
ws,
ApproximateMatcherOptions.IncludePrefixedForms);
Assert.AreEqual(3, matches.Count);
Assert.AreEqual("de Word1", matches[0]["Form"]);
Assert.AreEqual("de Word2", matches[1]["Form"]);
Assert.AreEqual("de Word3", matches[2]["Form"]);
}
}
示例2: GetAllEntriesSortedByDefinition_DefinitionAndGlossOfOneEntryAreIdentical_ReturnsOnlyOneRecordToken
public void GetAllEntriesSortedByDefinition_DefinitionAndGlossOfOneEntryAreIdentical_ReturnsOnlyOneRecordToken()
{
using (var env = new TestEnvironment())
{
env.CreateThreeDifferentLexEntries(delegate(LexEntry e)
{
e.Senses.Add(new LexSense());
return e.Senses[0].Definition;
});
LexEntry lexEntryWithBothDefinitionAndAGloss = env.Repository.CreateItem();
lexEntryWithBothDefinitionAndAGloss.Senses.Add(new LexSense());
lexEntryWithBothDefinitionAndAGloss.Senses[0].Definition.SetAlternative("de", "de Word4");
lexEntryWithBothDefinitionAndAGloss.Senses[0].Gloss.SetAlternative("de", "de Word4");
var german = WritingSystemDefinitionForTest("de");
ResultSet<LexEntry> listOfLexEntriesSortedByDefinition = env.Repository.GetAllEntriesSortedByDefinitionOrGloss(german);
Assert.AreEqual(4, listOfLexEntriesSortedByDefinition.Count);
Assert.AreEqual("de Word1", listOfLexEntriesSortedByDefinition[0]["Form"]);
Assert.AreEqual("de Word2", listOfLexEntriesSortedByDefinition[1]["Form"]);
Assert.AreEqual("de Word3", listOfLexEntriesSortedByDefinition[2]["Form"]);
Assert.AreEqual("de Word4", listOfLexEntriesSortedByDefinition[3]["Form"]);
}
}