private IEnumerable<TestRow> Explore(TestConfigurationMatrix matrix, TestMatrixExplorationKind explorationKind, TestRunStrategy testRunStrategy)
        {
            List<KeyValuePair<Dimension, IExplorationStrategy>> testShellDimensionsWithStrategies = new List<KeyValuePair<Dimension, IExplorationStrategy>>();
            List<IConstraint> testShellContraints = new List<IConstraint>();

            Dictionary<string, TestDimension> testDimensionsToExpand = new Dictionary<string, TestDimension>();
            foreach (var testDimension in matrix.Dimensions)
            {
                testDimensionsToExpand.Add(testDimension.Name, testDimension);
            }

            // Now override any dimensions for the run Strategy
            if (testRunStrategy != null)
            {
                foreach (var testDimension in testRunStrategy.OverrideDimensions)
                {
                    testDimensionsToExpand[testDimension.Name] = testDimension;
                }
            }
            
            // Add test matrix combinations
            this.GetFlattenDimensionsWithConstraints(testDimensionsToExpand.Values, testShellDimensionsWithStrategies, testShellContraints);
            
            // Create test dimension for the platforms
            var platformDimension = new Dimension<string>("Platform");
            var platformExplorationStrategy = new ExhaustiveIEnumerableStrategy<string>(matrix.TestAssemblies.Select(ta => ta.PlatformType.ToString()));
            testShellDimensionsWithStrategies.Add(new KeyValuePair<Dimension, IExplorationStrategy>(platformDimension, platformExplorationStrategy));

            CombinatorialStrategy testConfigurationExplorationStrategy = null;
            Matrix testShellMatrix = new Matrix(matrix.Name, testShellDimensionsWithStrategies.Select(pair => pair.Key).ToArray());

            if (explorationKind == TestMatrixExplorationKind.Exhaustive)
            {
                testConfigurationExplorationStrategy = new ExhaustiveCombinatorialStrategy(testShellMatrix, testShellContraints);
            }
            else
            {
                testConfigurationExplorationStrategy = new PairwiseStrategy(testShellMatrix, this.RandomNumberGenerator.Next, testShellContraints);
            }
            
            foreach (var ds in testShellDimensionsWithStrategies)
            {
                testConfigurationExplorationStrategy.SetDimensionStrategy(ds.Key, ds.Value);
            }

            List<TestRow> testRows = new List<TestRow>();
            foreach (var vector in testConfigurationExplorationStrategy.Explore())
            {
                Dictionary<string, string> rowValues = new Dictionary<string, string>();
                foreach (var testShellDimensionWithStrategy in testShellDimensionsWithStrategies)
                {
                    rowValues.Add(testShellDimensionWithStrategy.Key.Name, (string)vector.GetValue(testShellDimensionWithStrategy.Key));
                }

                testRows.Add(new TestRow(rowValues));
            }

            return testRows;
        }
        /// <summary>
        /// Explores the Test Configuration matrix and run strategy
        /// </summary>
        /// <param name="configurationMatrix">Configuration strategy to explore</param>
        /// <param name="testRunStrategyPriority">priority to override matrix dimensions with</param>
        /// <returns>Rows of the explored matrix</returns>
        public IEnumerable<TestRow> Explore(TestConfigurationMatrix configurationMatrix, int testRunStrategyPriority)
        {
            ExceptionUtilities.CheckArgumentNotNull(configurationMatrix, "configurationMatrix");

            var runStrategy = configurationMatrix.TestRunStrategies.Where(s => s.Priority == testRunStrategyPriority).SingleOrDefault();
            ExceptionUtilities.CheckObjectNotNull(runStrategy, "Expected to find a run Strategy with priority:{0}", testRunStrategyPriority);

            return this.Explore(configurationMatrix, runStrategy.ExplorationKind, runStrategy);
        }
        /// <summary>
        /// Explores the Test Configuration matrix and run strategy
        /// </summary>
        /// <param name="configurationMatrix">Configuration strategy to explore</param>
        /// <param name="testRunStrategyPriority">priority to override matrix dimensions with</param>
        /// <returns>Rows of the explored matrix</returns>
        public IEnumerable <TestRow> Explore(TestConfigurationMatrix configurationMatrix, int testRunStrategyPriority)
        {
            ExceptionUtilities.CheckArgumentNotNull(configurationMatrix, "configurationMatrix");

            var runStrategy = configurationMatrix.TestRunStrategies.Where(s => s.Priority == testRunStrategyPriority).SingleOrDefault();

            ExceptionUtilities.CheckObjectNotNull(runStrategy, "Expected to find a run Strategy with priority:{0}", testRunStrategyPriority);

            return(this.Explore(configurationMatrix, runStrategy.ExplorationKind, runStrategy));
        }
        private IEnumerable <TestRow> Explore(TestConfigurationMatrix matrix, TestMatrixExplorationKind explorationKind, TestRunStrategy testRunStrategy)
        {
            List <KeyValuePair <Dimension, IExplorationStrategy> > testShellDimensionsWithStrategies = new List <KeyValuePair <Dimension, IExplorationStrategy> >();
            List <IConstraint> testShellContraints = new List <IConstraint>();

            Dictionary <string, TestDimension> testDimensionsToExpand = new Dictionary <string, TestDimension>();

            foreach (var testDimension in matrix.Dimensions)
            {
                testDimensionsToExpand.Add(testDimension.Name, testDimension);
            }

            // Now override any dimensions for the run Strategy
            if (testRunStrategy != null)
            {
                foreach (var testDimension in testRunStrategy.OverrideDimensions)
                {
                    testDimensionsToExpand[testDimension.Name] = testDimension;
                }
            }

            // Add test matrix combinations
            this.GetFlattenDimensionsWithConstraints(testDimensionsToExpand.Values, testShellDimensionsWithStrategies, testShellContraints);

            // Create test dimension for the platforms
            var platformDimension           = new Dimension <string>("Platform");
            var platformExplorationStrategy = new ExhaustiveIEnumerableStrategy <string>(matrix.TestAssemblies.Select(ta => ta.PlatformType.ToString()));

            testShellDimensionsWithStrategies.Add(new KeyValuePair <Dimension, IExplorationStrategy>(platformDimension, platformExplorationStrategy));

            CombinatorialStrategy testConfigurationExplorationStrategy = null;
            Matrix testShellMatrix = new Matrix(matrix.Name, testShellDimensionsWithStrategies.Select(pair => pair.Key).ToArray());

            if (explorationKind == TestMatrixExplorationKind.Exhaustive)
            {
                testConfigurationExplorationStrategy = new ExhaustiveCombinatorialStrategy(testShellMatrix, testShellContraints);
            }
            else
            {
                testConfigurationExplorationStrategy = new PairwiseStrategy(testShellMatrix, this.RandomNumberGenerator.Next, testShellContraints);
            }

            foreach (var ds in testShellDimensionsWithStrategies)
            {
                testConfigurationExplorationStrategy.SetDimensionStrategy(ds.Key, ds.Value);
            }

            List <TestRow> testRows = new List <TestRow>();

            foreach (var vector in testConfigurationExplorationStrategy.Explore())
            {
                Dictionary <string, string> rowValues = new Dictionary <string, string>();
                foreach (var testShellDimensionWithStrategy in testShellDimensionsWithStrategies)
                {
                    rowValues.Add(testShellDimensionWithStrategy.Key.Name, (string)vector.GetValue(testShellDimensionWithStrategy.Key));
                }

                testRows.Add(new TestRow(rowValues));
            }

            return(testRows);
        }
        /// <summary>
        /// Explores the Test Configuration matrix
        /// </summary>
        /// <param name="configurationMatrix">Matrix to explore</param>
        /// <param name="explorationKind">Exploration kind, pairwise or exhaustive</param>
        /// <returns>Rows of the explored matrix</returns>
        public IEnumerable <TestRow> Explore(TestConfigurationMatrix configurationMatrix, TestMatrixExplorationKind explorationKind)
        {
            ExceptionUtilities.CheckArgumentNotNull(configurationMatrix, "configurationMatrix");

            return(this.Explore(configurationMatrix, explorationKind, null));
        }
        /// <summary>
        /// Explores the Test Configuration matrix
        /// </summary>
        /// <param name="configurationMatrix">Matrix to explore</param>
        /// <param name="explorationKind">Exploration kind, pairwise or exhaustive</param>
        /// <returns>Rows of the explored matrix</returns>
        public IEnumerable<TestRow> Explore(TestConfigurationMatrix configurationMatrix, TestMatrixExplorationKind explorationKind)
        {
            ExceptionUtilities.CheckArgumentNotNull(configurationMatrix, "configurationMatrix");

            return this.Explore(configurationMatrix, explorationKind, null);
        }