public async Task Test_Combobox_items_display_Test()//needs to be Task and without an assert statement the async method hangs?! { IList <Type> types = await AssemblyLoaderUtil.FindAllEntityTypesThatAllowRules(); Assert.IsNotNull(types); TestForm frm = new TestForm { ShowInTaskbar = false //<-- this enable forms to show up for testing! otherwise it doesn't show. }; //List<TypeNameItem> ojs = new List<TypeNameItem>(); //foreach (var type in types) //{ // ojs.Add(new TypeNameItem(type)); //} frm.LoadComboboxWithItems(types); frm.ShowDialog(); }
public JarsRulesForm() { InitializeComponent(); //discover all the entities that are marked with the AllowRules attribute. IList <Type> types = Task.Run(async() => { return(await AssemblyLoaderUtil.FindAllEntityTypesThatAllowRules()); }).Result; ctrl_cboSourceEntityType.SuspendLayout(); ctrl_cboTargetEntityType.SuspendLayout(); foreach (Type t in types) { ctrl_cboSourceEntityType.Properties.Items.Add(t.ToTypeNameItem()); ctrl_cboTargetEntityType.Properties.Items.Add(t.ToTypeNameItem()); } ctrl_cboSourceEntityType.ResumeLayout(true); ctrl_cboTargetEntityType.ResumeLayout(true); ctrl_cboRuleApplicators.Properties.AddEnum(typeof(RuleRunsOn)); ctrl_cboRuleValidWhen.Properties.Items.AddRange(Enum.GetNames(typeof(RulePassesWhen))); ctrl_cbRuleEvaluation.Properties.Items.AddRange(Enum.GetNames(typeof(RuleEvaluation))); }
public async Task Test_assembly_Loader_utility_Test()//test neetds to be Task to attach a debugger. { IList <Type> types = await AssemblyLoaderUtil.FindAllEntityTypesThatAllowRules(); Assert.IsNotNull(types); }