本文整理汇总了C#中TestEnvironment.SetDefinitionsInStore方法的典型用法代码示例。如果您正苦于以下问题:C# TestEnvironment.SetDefinitionsInStore方法的具体用法?C# TestEnvironment.SetDefinitionsInStore怎么用?C# TestEnvironment.SetDefinitionsInStore使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestEnvironment
的用法示例。
在下文中一共展示了TestEnvironment.SetDefinitionsInStore方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetTopLevelItems_OtherKnownWritingSystemsIsNull_Ok
[Test] // ok
public void GetTopLevelItems_OtherKnownWritingSystemsIsNull_Ok()
{
using (var e = new TestEnvironment())
{
e.SetDefinitionsInStore(new WritingSystemDefinition[] {});
var model = e.CreateModel();
model.Suggestor.OtherKnownWritingSystems = null;
AssertTreeNodeLabels(model, "Add Language");
}
}
示例2: GetTopLevelItems_StoreIsEmptyButOtherLanguagesAreAvailable_GivesOtherLanguageChoiceHeader
[Test] // ok
public void GetTopLevelItems_StoreIsEmptyButOtherLanguagesAreAvailable_GivesOtherLanguageChoiceHeader()
{
using (var e = new TestEnvironment())
{
e.SetDefinitionsInStore(new WritingSystemDefinition[] {});
var model = e.CreateModel();
model.Suggestor.OtherKnownWritingSystems = new List<Tuple<string, string>>()
{
new Tuple<string, string>("en", string.Empty)
};
AssertTreeNodeLabels(model, "Add Language", "", "Other Languages", "+Add English");
}
}
示例3: GetTopLevelItems_StoreAlreadyHasAllOsLanguages_DoesNotOfferToCreateItAgain
[Test] // ok
public void GetTopLevelItems_StoreAlreadyHasAllOsLanguages_DoesNotOfferToCreateItAgain()
{
using (var e = new TestEnvironment())
{
var en = new WritingSystemDefinition("en");
var de = new WritingSystemDefinition("de");
var model = e.CreateModel();
model.Suggestor.OtherKnownWritingSystems = new List<Tuple<string, string>>()
{
new Tuple<string, string>("de", string.Empty),
new Tuple<string, string>("fr", string.Empty)
};
e.SetDefinitionsInStore(new[] {en, de});
AssertTreeNodeLabels(
model,
"English", "German", "", "Add Language", "", "Other Languages", "+Add French" /*notice, no de*/
);
}
}
示例4: ClickExistingLanguage_SelectCalledOnSetupModel
[Test] // ok
public void ClickExistingLanguage_SelectCalledOnSetupModel()
{
/* the tree would look like this:
xyz <-- we're clicking this one
Add Language
*/
using (var e = new TestEnvironment())
{
var def = new WritingSystemDefinition("en");
e.SetDefinitionsInStore(new[] {def});
var model = e.CreateModel();
var items = model.GetTreeItems();
e.MockSetupModel.Setup(m => m.SetCurrentDefinition(def));
items.First().Clicked();
e.MockSetupModel.Verify(m => m.SetCurrentDefinition(def));
}
}
示例5: GetTopLevelItems_UsesSuggestor
public void GetTopLevelItems_UsesSuggestor()
{
using (var e = new TestEnvironment())
{
var etr = new WritingSystemDefinition("etr", string.Empty, string.Empty, string.Empty, "edo", false);
e.SetDefinitionsInStore(new[] {etr});
var model = e.CreateModel();
model.Suggestor.SuggestIpa = true;
AssertTreeNodeLabels(model, "Edolo", "+Add IPA input system for Edolo", "", "Add Language");
}
}
示例6: GetTopLevelItems_ThreeVariantsAreSyblings_ListsAllUnderGroupHeading
[Test] // ok
public void GetTopLevelItems_ThreeVariantsAreSyblings_ListsAllUnderGroupHeading()
{
using (var e = new TestEnvironment())
{
var thai = new WritingSystemDefinition("bzi", "Thai", string.Empty, string.Empty, "bt", false);
var my = new WritingSystemDefinition("bzi", "Mymr", string.Empty, string.Empty, "bm", false);
var latin = new WritingSystemDefinition("bzi", "Latn", string.Empty, string.Empty, "bl", false);
e.SetDefinitionsInStore(new[] {thai, my, latin});
var model = e.CreateModel();
AssertTreeNodeLabels(model, "Bisu", "+Bisu (Thai)", "+Bisu (Mymr)", "+Bisu (Latn)", "", "Add Language");
}
}
示例7: GetTopLevelItems_OneLanguageIsChildOfAnother_GivesParentOnly
[Test] // ok
public void GetTopLevelItems_OneLanguageIsChildOfAnother_GivesParentOnly()
{
using (var e = new TestEnvironment())
{
var etr = new WritingSystemDefinition("etr", string.Empty, string.Empty, string.Empty, "edo", false);
var etrIpa = new WritingSystemDefinition("etr", string.Empty, string.Empty, "fonipa", "edo", false);
e.SetDefinitionsInStore(new[] {etr, etrIpa});
var model = e.CreateModel();
model.Suggestor.SuggestIpa = true;
AssertTreeNodeLabels(model, "Edolo", "+Edolo (IPA)", "", "Add Language");
}
}
示例8: GetTopLevelItems_TwoLanguagesInStore_GivesBoth
[Test] // ok
public void GetTopLevelItems_TwoLanguagesInStore_GivesBoth()
{
using (var e = new TestEnvironment())
{
var xyz = new WritingSystemDefinition("en");
var abc = new WritingSystemDefinition("de");
var model = e.CreateModel();
e.SetDefinitionsInStore(new[] { abc, xyz });
AssertTreeNodeLabels(model, "German", "English", "", "Add Language");
}
}