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


C# TestEnvironment.CreateModel方法代码示例

本文整理汇总了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");
			}
		}
开发者ID:jwickberg,项目名称:libpalaso,代码行数:11,代码来源:WritingSystemTreeModelTests.cs

示例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");
			}
		}
开发者ID:jwickberg,项目名称:libpalaso,代码行数:14,代码来源:WritingSystemTreeModelTests.cs

示例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*/
				);
			}
		}
开发者ID:jwickberg,项目名称:libpalaso,代码行数:20,代码来源:WritingSystemTreeModelTests.cs

示例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));
			}
		}
开发者ID:jwickberg,项目名称:libpalaso,代码行数:29,代码来源:WritingSystemTreeModelTests.cs

示例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));
			}
		}
开发者ID:jwickberg,项目名称:libpalaso,代码行数:21,代码来源:WritingSystemTreeModelTests.cs

示例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");
			}
		}
开发者ID:jwickberg,项目名称:libpalaso,代码行数:14,代码来源:WritingSystemTreeModelTests.cs

示例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");
			}
		}
开发者ID:jwickberg,项目名称:libpalaso,代码行数:11,代码来源:WritingSystemTreeModelTests.cs

示例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");
			}
		}
开发者ID:jwickberg,项目名称:libpalaso,代码行数:13,代码来源:WritingSystemTreeModelTests.cs

示例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");
			}
		}
开发者ID:jwickberg,项目名称:libpalaso,代码行数:13,代码来源:WritingSystemTreeModelTests.cs

示例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");
			}
		}
开发者ID:jwickberg,项目名称:libpalaso,代码行数:12,代码来源:WritingSystemTreeModelTests.cs


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