public ProcessWideConfig(ProcessWideConfigSection processWideConfigSection)
 {
     this.LoggingLocation     = processWideConfigSection.LoggingLocation.Trim('\\');
     this.MaxThreads          = processWideConfigSection.MaxThreads != -1 ? processWideConfigSection.MaxThreads : Environment.ProcessorCount;
     this.BeforeTestExecution = processWideConfigSection.BeforeTestExecution;
     this.AfterTestExecution  = processWideConfigSection.AfterTestExecution;
     this.SemicolonSeparatedFilesHavingTestCases = processWideConfigSection.SemicolonSeparatedFilesHavingTestCases.Trim('\\');
     this.TestingFramework = processWideConfigSection.TestingFramework;
     this.TestRunner       = processWideConfigSection.TestRunner;
     this.MakeTestRunnerAsChildProcessOfPTR = processWideConfigSection.MakeTestRunnerAsChildProcessOfPTR;
     this.WorkingDirectoryOfTestRunner      = processWideConfigSection.WorkingDirectoryOfTestRunner.Trim('\\');
     this.ExecutionLocation      = processWideConfigSection.ExecutionLocation.Trim('\\');
     this.TestingProjectLocation = processWideConfigSection.TestingProjectLocation.Trim('\\');
     this.LoadTestingProjectBinariesFromItsOwnLocationOnly = processWideConfigSection.LoadTestingProjectBinariesFromItsOwnLocationOnly;
     this.TestCasesExtractor                     = processWideConfigSection.TestCasesExtractor;
     this.TestCategories                         = processWideConfigSection.TestCategories;
     this.TestClasses                            = processWideConfigSection.TestClasses;
     this.SemicolonSeparatedTestCases            = processWideConfigSection.SemicolonSeparatedTestCases;
     this.SemicolonSeparatedTestCasesToBeSkipped = processWideConfigSection.SemicolonSeparatedTestCasesToBeSkipped;
     this.BeforeRunConfigEditor                  = processWideConfigSection.BeforeRunConfigEditor;
     this.TimesToRerunFailedTestCases            = processWideConfigSection.TimesToRerunFailedTestCases;
     this.BeforeRerunConfigEditor                = processWideConfigSection.BeforeRerunConfigEditor;
     this.ThreadCount                            = processWideConfigSection.ThreadCount != -1 ? processWideConfigSection.ThreadCount : Environment.ProcessorCount;
     this.MinBucketSize                          = processWideConfigSection.MinBucketSize;
     this.MaxBucketSize                          = processWideConfigSection.MaxBucketSize;
     this.ConcurrentUnit                         = processWideConfigSection.ConcurrentUnit;
     this.ReportProcessor                        = processWideConfigSection.ReportProcessor;
     this.CleanAfterCompletion                   = processWideConfigSection.CleanAfterCompletion;
 }
        public TestingEnvironment(ProcessWideConfigSection processWideConfigSection,
                                  TestingConfigurationsSection testingConfigurationsSection,
                                  IObjectFactory Factory)
        {
            this.Agent = Factory;
            Factory.LogUtil.LogMessage("Creating testing environment...");

            Factory.LogUtil.LogMessage("Creating process wide configurations");
            this.ProcessWideConfig = new ProcessWideConfig(processWideConfigSection);

            Factory.LogUtil.LogMessage("Creating testing configurations...");
            var tempTestConfigCollection = testingConfigurationsSection.TestConfigSectionCollection.Select((x) => new TestConfig(x)).ToList();

            Factory.CommandLineProcessor.ApplyCommandLineArguments(this.ProcessWideConfig, tempTestConfigCollection);

            this.TestingConfigurations = new List <TestConfig>();
            foreach (var tempTestConfig in tempTestConfigCollection)
            {
                if (tempTestConfig.IsEnabled)
                {
                    this.ApplyProcessWideConfigurationsToTestConfigIfRequired(tempTestConfig);
                    this.CreateSeparateTestConfigurationForEachFileHavingTestCases(tempTestConfig);
                }
                else
                {
                    Factory.LogUtil.LogWarning(string.Format("Testing configuration {0} is disabled, so it is not being processed", tempTestConfig.Identifier));
                }
            }

            this.Update_SemicolonSeparatedConfigResultsToBeMergedInto_FieldInAllParallelConfigurations();

            this.UpdateProcessWideConfig();

            this.ValidateAllConfigurations();

            Factory.LogUtil.LogMessage("Copying all required components for all enabled testing configurations at their corresponding execution location...");
            this.CopyRequiredComponentsForAllEnabledConfigurationsAtTheirCorrespondingExecutionLocation();

            Factory.LogUtil.LogMessage("Testing environment is created successfully.");
        }