public PesterConfiguration()
 {
     Run          = new RunConfiguration();
     Filter       = new FilterConfiguration();
     CodeCoverage = new CodeCoverageConfiguration();
     TestResult   = new TestResultConfiguration();
     Should       = new ShouldConfiguration();
     Debug        = new DebugConfiguration();
     Output       = new OutputConfiguration();
 }
 public PesterConfiguration(IDictionary configuration)
 {
     if (configuration != null)
     {
         Run          = new RunConfiguration(configuration.GetIDictionaryOrNull("Run"));
         Filter       = new FilterConfiguration(configuration.GetIDictionaryOrNull("Filter"));
         CodeCoverage = new CodeCoverageConfiguration(configuration.GetIDictionaryOrNull("CodeCoverage"));
         TestResult   = new TestResultConfiguration(configuration.GetIDictionaryOrNull("TestResult"));
         Should       = new ShouldConfiguration(configuration.GetIDictionaryOrNull("Should"));
         Debug        = new DebugConfiguration(configuration.GetIDictionaryOrNull("Debug"));
         Output       = new OutputConfiguration(configuration.GetIDictionaryOrNull("Output"));
     }
 }
    public static PesterConfiguration ShallowClone(PesterConfiguration configuration)
    {
        var cfg = Default;

        cfg.Run          = RunConfiguration.ShallowClone(configuration.Run);
        cfg.Filter       = FilterConfiguration.ShallowClone(configuration.Filter);
        cfg.CodeCoverage = CodeCoverageConfiguration.ShallowClone(configuration.CodeCoverage);
        cfg.TestResult   = TestResultConfiguration.ShallowClone(configuration.TestResult);
        cfg.Should       = ShouldConfiguration.ShallowClone(configuration.Should);
        cfg.Debug        = DebugConfiguration.ShallowClone(configuration.Debug);
        cfg.Output       = OutputConfiguration.ShallowClone(configuration.Output);
        return(cfg);
    }
 public PesterConfiguration(IDictionary configuration)
 {
     if (configuration != null)
     {
         Run          = new RunConfiguration(configuration.GetIDictionaryOrNull(nameof(Run)));
         Filter       = new FilterConfiguration(configuration.GetIDictionaryOrNull(nameof(Filter)));
         CodeCoverage = new CodeCoverageConfiguration(configuration.GetIDictionaryOrNull(nameof(CodeCoverage)));
         TestResult   = new TestResultConfiguration(configuration.GetIDictionaryOrNull(nameof(TestResult)));
         Should       = new ShouldConfiguration(configuration.GetIDictionaryOrNull(nameof(Should)));
         Debug        = new DebugConfiguration(configuration.GetIDictionaryOrNull(nameof(Debug)));
         Output       = new OutputConfiguration(configuration.GetIDictionaryOrNull(nameof(Output)));
         TestDrive    = new TestDriveConfiguration(configuration.GetIDictionaryOrNull(nameof(TestDrive)));
         TestRegistry = new TestRegistryConfiguration(configuration.GetIDictionaryOrNull(nameof(TestRegistry)));
     }
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="ConfigurationTestResult"/> class.
        /// </summary>
        /// <param name="testResultConfiguration">Associated test result area configuration from w2t file.</param>
        public ConfigurationTestResult(TestResultConfiguration testResultConfiguration)
            : this()
        {
            TestResultConfiguration = testResultConfiguration;
            if (TestResultConfiguration == null)
            {
                return;
            }

            Available = TestResultConfiguration.Available;
            IncludeTestCasesWithoutResults = TestResultConfiguration.IncludeTestCasesWithoutResults;
            TestPlanTemplate                 = TestResultConfiguration.TestPlanTemplate;
            TestSuiteTemplate                = TestResultConfiguration.TestSuiteTemplate;
            RootTestSuiteTemplate            = TestResultConfiguration.RootTestSuiteTemplate ?? TestSuiteTemplate;
            LeafTestSuiteTemplate            = TestResultConfiguration.LeafTestSuiteTemplate ?? TestSuiteTemplate;
            TestCaseElementTemplate          = TestResultConfiguration.TestCaseElementTemplate;
            TestResultElementTemplate        = TestResultConfiguration.TestResultElementTemplate;
            TestConfigurationElementTemplate = TestResultConfiguration.TestConfigurationElementTemplate;
            SummaryPageTemplate              = TestResultConfiguration.SummaryPageTemplate;
            BuildQualities = TestResultConfiguration.BuildQualities;
            BuildFilters   = TestResultConfiguration.BuildFilters;
            DefaultValues  = TestResultConfiguration.DefaultValues;

            if (TestResultConfiguration.PreOperations != null && TestResultConfiguration.PreOperations.Count > 0)
            {
                PreOperations = new List <IConfigurationTestOperation>();
                foreach (var operation in TestResultConfiguration.PreOperations)
                {
                    PreOperations.Add(new ConfigurationTestOperation(operation));
                }
            }
            if (TestResultConfiguration.PostOperations != null && TestResultConfiguration.PostOperations.Count > 0)
            {
                PostOperations = new List <IConfigurationTestOperation>();
                foreach (var operation in TestResultConfiguration.PostOperations)
                {
                    PostOperations.Add(new ConfigurationTestOperation(operation));
                }
            }
        }