public TestAssemblyRunner(ITestAssembly testAssembly,
                                  IEnumerable <IXunitTestCase> testCases,
                                  IMessageSink diagnosticMessageSink,
                                  IMessageSink executionMessageSink,
                                  ITestFrameworkExecutionOptions executionOptions)
            : base(testAssembly, testCases, diagnosticMessageSink, executionMessageSink, executionOptions)
        {
            var tests = OrderTestCollections();

            this.RunIntegrationTests = executionOptions.GetValue <bool>(nameof(ElasticXunitRunOptions.RunIntegrationTests));
            this.RunUnitTests        = executionOptions.GetValue <bool>(nameof(ElasticXunitRunOptions.RunUnitTests));
            this.TestFilter          = executionOptions.GetValue <string>(nameof(ElasticXunitRunOptions.TestFilter));
            this.ClusterFilter       = executionOptions.GetValue <string>(nameof(ElasticXunitRunOptions.ClusterFilter));

            //bit side effecty, sets up _assemblyFixtureMappings before possibly letting xunit do its regular concurrency thing
            this._grouped = (from c in tests
                             let cluster = ClusterFixture(c.Item2.First().TestMethod.TestClass)
                                           let testcase = new GroupedByCluster {
                Collection = c.Item1, TestCases = c.Item2, Cluster = cluster
            }
                             group testcase by testcase.Cluster
                             into g
                             orderby g.Count() descending
                             select g).ToList();
        }
 /// <summary>
 /// Gets a flag that determines whether xUnit.net should report test results synchronously.
 /// </summary>
 public static bool?SynchronousMessageReporting(this ITestFrameworkExecutionOptions executionOptions)
 {
     return(executionOptions.GetValue <bool?>(TestOptionsNames.Execution.SynchronousMessageReporting));
 }
 /// <summary>
 /// Gets a flag to stop testing on test failure.
 /// </summary>
 public static bool?StopOnTestFail(this ITestFrameworkExecutionOptions executionOptions)
 {
     return(executionOptions.GetValue <bool?>(TestOptionsNames.Execution.StopOnFail));
 }
 /// <summary>
 /// Gets the maximum number of threads to use when running tests in parallel.
 /// </summary>
 public static int?MaxParallelThreads(this ITestFrameworkExecutionOptions executionOptions)
 {
     return(executionOptions.GetValue <int?>(TestOptionsNames.Execution.MaxParallelThreads));
 }
 /// <summary>
 /// Gets a flag to disable parallelization.
 /// </summary>
 public static bool?DisableParallelization(this ITestFrameworkExecutionOptions executionOptions)
 {
     return(executionOptions.GetValue <bool?>(TestOptionsNames.Execution.DisableParallelization));
 }
    // Read methods for ITestFrameworkExecutionOptions

    /// <summary>
    /// Gets a flag that determines whether diagnostic messages will be emitted.
    /// </summary>
    public static bool?DiagnosticMessages(this ITestFrameworkExecutionOptions executionOptions)
    {
        return(executionOptions.GetValue <bool?>(TestOptionsNames.Execution.DiagnosticMessages));
    }