本文整理汇总了C#中TestEnvironment.CreateModel方法的典型用法代码示例。如果您正苦于以下问题:C# TestEnvironment.CreateModel方法的具体用法?C# TestEnvironment.CreateModel怎么用?C# TestEnvironment.CreateModel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestEnvironment
的用法示例。
在下文中一共展示了TestEnvironment.CreateModel方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: ClickAddPredefinedLanguage_AddNewCalledOnSetupModel
[Test] // ok
public void ClickAddPredefinedLanguage_AddNewCalledOnSetupModel()
{
/* the tree would look like this:
Add Language
Other Languages
Add xyz <-- we're clicking this one
*/
using (var e = new TestEnvironment())
{
var def = new WritingSystemDefinition("en")
{
DefaultFontSize = 12
};
e.TestWritingSystemFactory.WritingSystems.Add(def);
var model = e.CreateModel();
model.Suggestor.OtherKnownWritingSystems = new List<Tuple<string, string>>()
{
new Tuple<string, string>("en", string.Empty)
};
var items = model.GetTreeItems();
e.MockSetupModel.Setup(m => m.AddPredefinedDefinition(def));
items.Last().Children.First().Clicked();
e.MockSetupModel.Verify(m => m.AddPredefinedDefinition(def));
}
}
示例5: 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));
}
}
示例6: ClickAddLanguage_AddNewCalledOnSetupModel
public void ClickAddLanguage_AddNewCalledOnSetupModel()
{
/* the tree would look like this:
Add Language <-- we're clicking this one
*/
using (var e = new TestEnvironment())
{
var model = e.CreateModel();
var items = model.GetTreeItems();
items.First().Clicked();
e.MockSetupModel.Setup(m => m.AddNew());
e.MockSetupModel.Verify(m => m.AddNew(), "Should have called the AddNew method on the setup model");
}
}
示例7: 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");
}
}
示例8: 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");
}
}
示例9: 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");
}
}
示例10: 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");
}
}