private static void initializeTestProperties(string testPropertiesFile)
        {
            if (!string.IsNullOrEmpty(testPropertiesFile))
            {
                Uri testPropertiesUri = loadTestProperties(testPropertiesFile);

                if (testPropertiesUri == null)
                {
                    TestProperties.Initialize();
                }
            }
            else
            {
                TestProperties.Initialize();
            }

            if (!string.IsNullOrEmpty(testEnvironments))
            {
                var testPropertyOverrides = TestProperties.GetTestProperityOverrides(testEnvironments);

                if (testPropertyOverrides != null)
                {
                    TestProperties.ApplyTestPropertyOverrides(testPropertyOverrides);
                }
                else
                {
                    LogEvent.Info($"The test environment \"{testEnvironments }\" has been specified, " +
                                  "however it was not located in the application configuration file.");

                    exitCode = ExitCode.TestPropertiesError;
                }
            }
        }
Esempio n. 2
0
        private void initializeTestProperties()
        {
            if (!string.IsNullOrEmpty(Program.TestPropertiesFile))
            {
                Uri testPropertiesUri = loadTestProperties(Program.TestPropertiesFile);

                if (testPropertiesUri != null)
                {
                    m_testPropertiesUri = testPropertiesUri;
                    m_testPropertiesStatusBarLabel.Text = Path.GetFileName(m_testPropertiesUri.LocalPath);
                }
                else
                {
                    TestProperties.Initialize();
                    m_testPropertiesStatusBarLabel.Text = "Default test properties";
                }
            }
            else
            {
                TestProperties.Initialize();
                m_testPropertiesStatusBarLabel.Text = "Default test properties";
            }

            if (!string.IsNullOrEmpty(Program.TestEnvironments))
            {
                _testPropertyOverrides = TestProperties.GetTestProperityOverrides(Program.TestEnvironments);

                if (_testPropertyOverrides != null)
                {
                    var unused = TestProperties.ApplyTestPropertyOverrides(_testPropertyOverrides);

                    if (unused.Count > 0)
                    {
                        displayUnusedOverridesMessage(unused);
                    }
                }
                else
                {
                    MessageBox.Show(this, $"The test environment \"{Program.TestEnvironments }\" has been specified, " +
                                    "however it was not located in the application configuration file.",
                                    "Quintity TestEngineer", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }