private void saveWorkerOptionsButton_Click(object sender, EventArgs e)
        {
            string maxWorkersNumberText = maxNumberOfWorkersNumericSetter.Value.ToString( );

            DictionaryManipulators handleRunOptionsDictionary = new DictionaryManipulators( );

            if (maxNumberOfWorkersNumericSetter.Value != workersMaximumNumberInitial)
            {
                handleRunOptionsDictionary.AddToDictionary(RunOptionsEnums.WorkersMaximumNumber, maxWorkersNumberText, editWorkersRunOptionsDictionary);

                workersMaximumNumSuccessfullChangedMessageLabel.Text = $"The new workers maximum number is set to: {maxWorkersNumberText}";
            }

            string defaultWorkersNumberText = defaultNumberOfWorkersSetterInput.Value.ToString( );

            if (defaultNumberOfWorkersSetterInput.Value != workersDefaultNumberInitial)
            {
                handleRunOptionsDictionary.AddToDictionary(RunOptionsEnums.WorkersDefaultNumber, defaultWorkersNumberText, editWorkersRunOptionsDictionary);

                workersDefaultNumSuccessfullChangedMessageLabel.Text = $"The new workers default number is set to: {defaultWorkersNumberText}";
            }

            EditRunOptionsBase editReportRunOptionsBase = new EditRunOptionsBase(true);

            editReportRunOptionsBase.EditFormRunOptionsDictionary = editWorkersRunOptionsDictionary;
        }
        private void saveBrowserOptionsButton_Click(object sender, EventArgs e)
        {
            DictionaryManipulators handleRunOptionsDictionary = new DictionaryManipulators( );

            if (!string.IsNullOrEmpty(nunitPathTextBox.Text))
            {
                string nunitPathText = nunitPathTextBox.Text;

                handleRunOptionsDictionary.AddToDictionary(RunOptionsEnums.NunitPath, nunitPathText, generalSettingsRunOptionsDictionary);

                SetLabelPosition(nunitPathTextBox, nunitPathChangeMessageLabel1, 400);

                nunitPathChangeMessageLabel1.Text = $"'{nunitPathText}'";
                nunitPathChangeMessageLabel2.Text = "set as the nunit3-console.exe path";
            }

            if (!string.IsNullOrEmpty(msBuildPathTextBox.Text))
            {
                string msBuildPathText = msBuildPathTextBox.Text;

                handleRunOptionsDictionary.AddToDictionary(RunOptionsEnums.MsBuildPath, msBuildPathText, generalSettingsRunOptionsDictionary);

                SetLabelPosition(msBuildPathTextBox, msBuildPathChangeMessageLabel1, 450);

                msBuildPathChangeMessageLabel1.Text = $"'{msBuildPathText}'";
                msBuildPathChangeMessageLabel2.Text = "set as the MSBuild.exe path";
            }

            EditRunOptionsBase editReportRunOptionsBase = new EditRunOptionsBase(true);

            editReportRunOptionsBase.EditFormRunOptionsDictionary = generalSettingsRunOptionsDictionary;
        }
Esempio n. 3
0
        private void saveBuildableLinkedButton_Click(object sender, EventArgs e)
        {
            string currentSelectedBuildablePath = pathToBuildableTextBox.Text;

            if (testListDropdown.SelectedIndex > -1 && !string.IsNullOrEmpty(currentSelectedBuildablePath))
            {
                string currentSelectedTestName = testListDropdown.GetItemText(testListDropdown.SelectedItem);

                DialogResult linkTestWithBuildable =
                    MessageBox.Show($"Are You sure, you want to link: '{currentSelectedTestName}'" +
                                    Environment.NewLine + $"with this test buildable: '{currentSelectedBuildablePath}'?",
                                    "Link Test with Buildable", MessageBoxButtons.OKCancel);

                if (linkTestWithBuildable == DialogResult.OK)
                {
                    DictionaryManipulators handleDictionary = new DictionaryManipulators( );

                    bool successfullyAddedToDictionary = handleDictionary.AddLinkedTestWithBuildableDictionary(
                        currentSelectedTestName, currentSelectedBuildablePath, testNameAndBuildableDictionary);

                    string message;

                    if (successfullyAddedToDictionary)
                    {
                        LinkTestListBuildable serializationLinkBuildables = new LinkTestListBuildable(testNameAndBuildableDictionary);

                        serializationLinkBuildables.SerializeTestDictionary( );

                        message = $"You are successfully linked '{currentSelectedTestName}' test with"
                                  + Environment.NewLine + currentSelectedBuildablePath + Environment.NewLine + "buildable.";
                    }
                    else
                    {
                        message = $"Something went wrong, when tried to link '{currentSelectedTestName}' test with"
                                  + Environment.NewLine + currentSelectedBuildablePath + Environment.NewLine +
                                  "buildable. Please try again, and if the issue still exist, contact TestSharp team.";
                    }

                    testBuildableSuccessfulLinkedMessage.Text = message;
                }

                testListDropdown.SelectedIndex = -1;
                pathToBuildableTextBox.Clear( );
            }
        }
        private void saveBrowserOptionsButton_Click(object sender, EventArgs e)
        {
            browserOptionsSuccessfullChangeMessageLabel.Location = messageLocation;

            if (defaultBrowserSelector.SelectedIndex > -1)
            {
                DictionaryManipulators handleRunOptionsDictionary = new DictionaryManipulators( );

                string defaultBrowserSelectedItemText = defaultBrowserSelector.SelectedItem.ToString();
                handleRunOptionsDictionary.AddToDictionary(RunOptionsEnums.DefaultBrowser, defaultBrowserSelectedItemText, editBrowsersRunOptionsDictionary);

                browserOptionsSuccessfullChangeMessageLabel.Text = $"'{defaultBrowserSelectedItemText}' selected as the new default browser";
            }

            EditRunOptionsBase editReportRunOptionsBase = new EditRunOptionsBase(true);

            editReportRunOptionsBase.EditFormRunOptionsDictionary = editBrowsersRunOptionsDictionary;
            editReportRunOptionsBase.EditFormBrowserList          = editBrowsersList;
        }
Esempio n. 5
0
        private void saveDropdownChangesButton_Click(object sender, EventArgs e)
        {
            string selectedTestFromDropdown    = testListDropdown.GetItemText(testListDropdown.SelectedItem);
            string givenNameFromNameInputField = givenNameTextBox.Text;
            string givenPathFromPathInputField = currentPathTextBox.Text;

            DialogResult editListResult =
                MessageBox.Show($"Are You sure, you want to edit: '{selectedTestFromDropdown}'?" +
                                Environment.NewLine + $"New name will be: '{givenNameFromNameInputField}'." +
                                Environment.NewLine + $"New path will be: '{givenPathFromPathInputField}'.", "Edit Test List", MessageBoxButtons.OKCancel);

            if (editListResult == DialogResult.OK)
            {
                DictionaryManipulators handleDictionary = new DictionaryManipulators( );

                handleDictionary.EditTestDictionary(selectedTestFromDropdown, givenNameFromNameInputField, givenPathFromPathInputField);

                loadDataHandler.LoadInTestListToDropdown(testListDropdown, TestRunnerGUI.testDictionary);

                currentPathTextBox.Clear( );

                givenNameTextBox.Clear( );
            }
        }
        private void saveReportOptionsButton_Click(object sender, EventArgs e)
        {
            DictionaryManipulators handleRunOptionsDictionary = new DictionaryManipulators( );

            string reportOutputPathTextBoxText = reportOutputPathTextBox.Text;

            bool reportOutputPathChanged = handleRunOptionsDictionary.AddToDictionary(RunOptionsEnums.ReportFolderPath, reportOutputPathTextBoxText, editReportRunOptionsDictionary);

            string textReportFileNameText = textReportFileName.Text;

            bool textReportNameChanged = handleRunOptionsDictionary.AddToDictionary(RunOptionsEnums.TextReportFileName, textReportFileNameText, editReportRunOptionsDictionary);

            string xmlReportFileNameText = xmlReportFileName.Text;

            bool xmlReportNameChanged = handleRunOptionsDictionary.AddToDictionary(RunOptionsEnums.XmlReportFileName, xmlReportFileNameText, editReportRunOptionsDictionary);

            bool isNunitTwoStyleRadioButtonChecked = nunitTwoStyleRadioButton.Checked;

            bool isNunitThreeStyleRadioButtonChecked = nunitThreeStyleRadioButton.Checked;

            bool xmlReportStyleChanged = false;

            if (isNunitTwoStyleRadioButtonChecked)
            {
                xmlReportStyleChanged = handleRunOptionsDictionary.AddToDictionary(RunOptionsEnums.XmlNunitStyle, "nunit2", editReportRunOptionsDictionary);
            }
            else if (isNunitThreeStyleRadioButtonChecked)
            {
                xmlReportStyleChanged = handleRunOptionsDictionary.AddToDictionary(RunOptionsEnums.XmlNunitStyle, "nunit3", editReportRunOptionsDictionary);
            }

            Queue <string> labelMessageQueue = new Queue <string>( );

            labelMessageQueue.Enqueue("Report options changed:");

            if (textReportNameChanged)
            {
                labelMessageQueue.Enqueue(" text report name");
            }

            if (reportOutputPathChanged)
            {
                labelMessageQueue.Enqueue(" report output folder");
            }

            if (xmlReportNameChanged)
            {
                labelMessageQueue.Enqueue(" xml report name");
            }

            if (xmlReportStyleChanged)
            {
                labelMessageQueue.Enqueue(" xml report style options");
            }

            StringBuilder stringBuilder = new StringBuilder( );

            int labelMessageQueueCount = labelMessageQueue.Count;

            if (labelMessageQueueCount < 3)
            {
                reportOptionsSuccessfulEditedLabel.Location = new Point(217, 466);
            }
            else if (labelMessageQueueCount == 3)
            {
                reportOptionsSuccessfulEditedLabel.Location = new Point(170, 466);
            }
            else
            {
                reportOptionsSuccessfulEditedLabel.Location = new Point(140, 466);
            }

            for (int i = 0; i < labelMessageQueueCount; ++i)
            {
                if (i == 0 || i == labelMessageQueueCount - 1)
                {
                    stringBuilder.Append(labelMessageQueue.Dequeue());
                }
                else
                {
                    stringBuilder.Append(labelMessageQueue.Dequeue( ));
                    stringBuilder.Append(",");
                }
            }

            string labelMessage = stringBuilder.ToString( );

            reportOptionsSuccessfulEditedLabel.Text = labelMessage;

            EditRunOptionsBase editReportRunOptionsBase = new EditRunOptionsBase(true);

            editReportRunOptionsBase.EditFormRunOptionsDictionary = editReportRunOptionsDictionary;
        }