Exemplo n.º 1
0
        private void SelectCategoryComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            SelectModuleComboBox.Items.Clear();
            SelectTestCaseComboBox.Items.Clear();
            ClearGrid();
            try
            {
                Dictionary <string, List <string> > moduleTestCaseDictionary = new Dictionary <string, List <string> >();

                if (e.AddedItems.Count > 0)
                {
                    if (BuildDefinition.Contains(','))
                    {
                        foreach (string bDef in BuildDefinition.Split(','))
                        {
                            try
                            {
                                moduleTestCaseDictionary = ProductDetails.GetModuleTestCaseDictionary(bDef,
                                                                                                      TestDllNameComboBox.SelectedValue.ToString(), SelectCategoryComboBox.SelectedValue.ToString());
                            }
                            catch
                            {
                                LoggerUtil.LogMessageToFile("Build Definition : " + bDef + " does not contain the Module selected by the user.");
                            }
                        }
                    }
                    else
                    {
                        moduleTestCaseDictionary = ProductDetails.GetModuleTestCaseDictionary(BuildDefinition,
                                                                                              TestDllNameComboBox.SelectedValue.ToString(), SelectCategoryComboBox.SelectedValue.ToString());
                    }
                    var modulelist = moduleTestCaseDictionary.Keys.ToList();
                    if (modulelist.Count == 0)
                    {
                        throw new Exception("Selected Dll is not a test Dll");
                    }
                    modulelist.Sort();

                    foreach (var key in modulelist)
                    {
                        SelectModuleComboBox.Items.Add(key);
                    }
                }
            }
            catch (Exception exception)
            {
                DisplayErrorMessage("Loading Modules Failed - " + exception.Message);
            }
            finally
            {
                //ProgressRing.IsActive = false;
            }
        }
Exemplo n.º 2
0
        private void SelectModuleComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ProgressBarDisplay();
            ClearGrid();
            SelectTestCaseComboBox.Items.Clear();

            try
            {
                if (e.AddedItems.Count > 0)
                {
                    var selectedModule = SelectModuleComboBox.SelectedValue.ToString();
                    Dictionary <string, List <string> > moduleTestCaseDictionary = new Dictionary <string, List <string> >();

                    if (BuildDefinition.Contains(','))
                    {
                        foreach (string bDef in BuildDefinition.Split(','))
                        {
                            try
                            {
                                moduleTestCaseDictionary = ProductDetails.GetModuleTestCaseDictionary(bDef,
                                                                                                      TestDllNameComboBox.SelectedValue.ToString(), SelectCategoryComboBox.SelectedValue.ToString());
                                TotalTestCases.Text = moduleTestCaseDictionary[SelectModuleComboBox.SelectedValue.ToString()].Count.ToString();
                            }
                            catch
                            {
                                LoggerUtil.LogMessageToFile("Build Definition : " + bDef + " does not contain the Module selected by the user.");
                            }
                        }
                    }
                    else
                    {
                        moduleTestCaseDictionary = ProductDetails.GetModuleTestCaseDictionary(BuildDefinition,
                                                                                              TestDllNameComboBox.SelectedValue.ToString(), SelectCategoryComboBox.SelectedValue.ToString());
                    }


                    var testCaselist = moduleTestCaseDictionary[selectedModule];

                    testCaselist.Sort();

                    for (int i = 0; i < SelectTestCaseComboBox.Items.Count; i++)
                    {
                        SelectTestCaseComboBox.Items.RemoveAt(i);
                        i--;
                    }

                    SelectTestCaseComboBox.Items.Add("All");

                    foreach (string testCase in testCaselist)
                    {
                        SelectTestCaseComboBox.Items.Add(testCase);
                    }
                }
            }
            catch (Exception exception)
            {
                DisplayErrorMessage("Loading TestCases Failed - " + exception.Message);
            }
            finally
            {
                InactiveDisplayComponents();
            }
        }