Ejemplo n.º 1
0
        /// <summary>
        /// Creates an instance of <see cref="_TestFrameworkOptions"/> for execution purposes.
        /// </summary>
        /// <param name="configuration">The optional configuration to copy values from.</param>
        public static _ITestFrameworkExecutionOptions ForExecution(TestAssemblyConfiguration?configuration = null)
        {
            _ITestFrameworkExecutionOptions result = new _TestFrameworkOptions();

            if (configuration != null)
            {
                result.SetDiagnosticMessages(configuration.DiagnosticMessages);
                result.SetDisableParallelization(!configuration.ParallelizeTestCollections);
                result.SetInternalDiagnosticMessages(configuration.InternalDiagnosticMessages);
                result.SetMaxParallelThreads(configuration.MaxParallelThreads);
                result.SetStopOnTestFail(configuration.StopOnFail);
            }

            return(result);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates an instance of <see cref="_TestFrameworkOptions"/> for discovery purposes.
        /// </summary>
        /// <param name="configuration">The optional configuration to copy values from.</param>
        public static _ITestFrameworkDiscoveryOptions ForDiscovery(TestAssemblyConfiguration?configuration = null)
        {
            _ITestFrameworkDiscoveryOptions result = new _TestFrameworkOptions();

            if (configuration != null)
            {
                result.SetDiagnosticMessages(configuration.DiagnosticMessages);
                result.SetIncludeSourceInformation(configuration.IncludeSourceInformation);
                result.SetInternalDiagnosticMessages(configuration.InternalDiagnosticMessages);
                result.SetMethodDisplay(configuration.MethodDisplay);
                result.SetMethodDisplayOptions(configuration.MethodDisplayOptions);
                result.SetPreEnumerateTheories(configuration.PreEnumerateTheories);
            }

            return(result);
        }