public void CheckForExistingCodeAndShowAlert() { var projectTestCases = ReadRobotFiles.ReadAllTests(); SuiteSettingsList = ReadRobotFiles.ReadAllSettings(); GlobalVariables = ReadRobotFiles.ReadAllVariables(); if (projectTestCases.Count == 0) { return; } var result = MessageBox.Show(@"Use existing Test Cases in project folder?", @"Alert", MessageBoxButtons.YesNo); if (!result.Equals(DialogResult.Yes)) { return; } TestCases = projectTestCases; foreach (var testCase in projectTestCases) { if (testCase.Steps == null) { continue; } foreach (var keyword in testCase.Steps) { KeywordToSuggestions(keyword); } } if (SuiteSettingsList.Count != 0) { return; } foreach (var suiteSetting in SuiteSettingsList) { if (suiteSetting.GetKeywords().Count == 0) { continue; } foreach (Keyword keyword in suiteSetting.GetKeywords()) { KeywordToSuggestions(keyword); } } SuggestionsClass.UpdateSuggestionsToIncludes(TestCases, SuiteSettingsList); }
private void BrowseFolderButtonExistingProject() { FormSetup(folderBrowserDialog2.SelectedPath); TestCases = ReadRobotFiles.ReadAllTests(); if (TestCases.Count != 0) { SuiteSettingsList = ReadRobotFiles.ReadAllSettings(); GlobalVariables = ReadRobotFiles.ReadAllVariables(); if (SuiteSettingsList.Count != 0) { foreach (var tempKeyword in SuiteSettingsList) { if (tempKeyword.GetKeywords().Count == 0) { continue; } foreach (var keyword in tempKeyword.GetKeywords()) { KeywordToSuggestions(keyword); } } } foreach (var testCase in TestCases) { if (testCase.Steps == null) { continue; } foreach (var tempKeyword in testCase.Steps) { KeywordToSuggestions(tempKeyword); } } TestCases.Sort(); SuggestionsClass.UpdateSuggestionsToIncludes(TestCases, SuiteSettingsList); AddTestCaseToFormAndShow(false); } else { MessageBox.Show(@"No test cases in the selected folder!", @"Alert", MessageBoxButtons.OK); } }