|
1 | 1 | using System; |
2 | 2 | using System.Collections.Generic; |
3 | | -using System.ComponentModel; |
4 | 3 | using System.Linq; |
5 | 4 | using System.Threading; |
6 | 5 | using Xunit.Abstractions; |
@@ -203,85 +202,15 @@ ITestFrameworkExecutionOptions GetExecutionOptions(bool? diagnosticMessages, boo |
203 | 202 | return executionOptions; |
204 | 203 | } |
205 | 204 |
|
206 | | - /// <summary> |
207 | | - /// Obsolete method. Call the overload with parallelAlgorithm. |
208 | | - /// </summary> |
209 | | - [EditorBrowsable(EditorBrowsableState.Never)] |
210 | | - [Obsolete("Please use the overload with startOptions")] |
211 | | - public void Start(string typeName = null, |
212 | | - bool? diagnosticMessages = null, |
213 | | - TestMethodDisplay? methodDisplay = null, |
214 | | - TestMethodDisplayOptions? methodDisplayOptions = null, |
215 | | - bool? preEnumerateTheories = null, |
216 | | - bool? parallel = null, |
217 | | - int? maxParallelThreads = null, |
218 | | - bool? internalDiagnosticMessages = null) => |
219 | | - Start(new AssemblyRunnerStartOptions() |
220 | | - { |
221 | | - DiagnosticMessages = diagnosticMessages, |
222 | | - InternalDiagnosticMessages = internalDiagnosticMessages, |
223 | | - MaxParallelThreads = maxParallelThreads, |
224 | | - MethodDisplay = methodDisplay, |
225 | | - MethodDisplayOptions = methodDisplayOptions, |
226 | | - Parallel = parallel, |
227 | | - PreEnumerateTheories = preEnumerateTheories, |
228 | | - TypesToRun = typeName == null ? new string[0] : new string[1] { typeName }, |
229 | | - }); |
230 | | - |
231 | | - /// <summary> |
232 | | - /// Starts running tests from a single type (if provided) or the whole assembly (if not). This call returns |
233 | | - /// immediately, and status results are dispatched to the events on this class. Callers can check <see cref="Status"/> |
234 | | - /// to find out the current status. |
235 | | - /// </summary> |
236 | | - /// <param name="typeName">The (optional) type name of the single test class to run</param> |
237 | | - /// <param name="diagnosticMessages">Set to <c>true</c> to enable diagnostic messages; set to <c>false</c> to disable them. |
238 | | - /// By default, uses the value from the assembly configuration file.</param> |
239 | | - /// <param name="methodDisplay">Set to choose the default display name style for test methods. |
240 | | - /// By default, uses the value from the assembly configuration file. (This parameter is ignored for xUnit.net v1 tests.)</param> |
241 | | - /// <param name="methodDisplayOptions">Set to choose the default display name style options for test methods. |
242 | | - /// By default, uses the value from the assembly configuration file. (This parameter is ignored for xUnit.net v1 tests.)</param> |
243 | | - /// <param name="preEnumerateTheories">Set to <c>true</c> to pre-enumerate individual theory tests; set to <c>false</c> to use |
244 | | - /// a single test case for the theory. By default, uses the value from the assembly configuration file. (This parameter is ignored |
245 | | - /// for xUnit.net v1 tests.)</param> |
246 | | - /// <param name="parallel">Set to <c>true</c> to run test collections in parallel; set to <c>false</c> to run them sequentially. |
247 | | - /// By default, uses the value from the assembly configuration file. (This parameter is ignored for xUnit.net v1 tests.)</param> |
248 | | - /// <param name="maxParallelThreads">Set to 0 to use unlimited threads; set to any other positive integer to limit to an exact number |
249 | | - /// of threads. By default, uses the value from the assembly configuration file. (This parameter is ignored for xUnit.net v1 tests.)</param> |
250 | | - /// <param name="internalDiagnosticMessages">Set to <c>true</c> to enable internal diagnostic messages; set to <c>false</c> to disable them. |
251 | | - /// By default, uses the value from the assembly configuration file.</param> |
252 | | - /// <param name="parallelAlgorithm">The parallel algorithm to be used; defaults to <see cref="ParallelAlgorithm.Conservative"/>.</param> |
253 | | - [EditorBrowsable(EditorBrowsableState.Never)] |
254 | | - [Obsolete("Please use the overload with startOptions")] |
255 | | - public void Start(string typeName = null, |
256 | | - bool? diagnosticMessages = null, |
257 | | - TestMethodDisplay? methodDisplay = null, |
258 | | - TestMethodDisplayOptions? methodDisplayOptions = null, |
259 | | - bool? preEnumerateTheories = null, |
260 | | - bool? parallel = null, |
261 | | - int? maxParallelThreads = null, |
262 | | - bool? internalDiagnosticMessages = null, |
263 | | - ParallelAlgorithm? parallelAlgorithm = null) => |
264 | | - Start(new AssemblyRunnerStartOptions() |
265 | | - { |
266 | | - DiagnosticMessages = diagnosticMessages, |
267 | | - InternalDiagnosticMessages = internalDiagnosticMessages, |
268 | | - MaxParallelThreads = maxParallelThreads, |
269 | | - MethodDisplay = methodDisplay, |
270 | | - MethodDisplayOptions = methodDisplayOptions, |
271 | | - Parallel = parallel, |
272 | | - ParallelAlgorithm = parallelAlgorithm, |
273 | | - PreEnumerateTheories = preEnumerateTheories, |
274 | | - TypesToRun = typeName == null ? new string[0] : new string[1] { typeName }, |
275 | | - }); |
276 | | - |
277 | 205 | /// <summary> |
278 | 206 | /// Starts running tests. This call returns immediately, and status results are dispatched to the |
279 | 207 | /// events on this class. Callers can check <see cref="Status"/> to find out the current status. |
280 | 208 | /// </summary> |
281 | | - /// <param name="startOptions">The start options. For default values, you may pass |
282 | | - /// <see cref="AssemblyRunnerStartOptions.Empty"/>.</param> |
283 | | - public void Start(AssemblyRunnerStartOptions startOptions) |
| 209 | + /// <param name="startOptions">The optional start options.</param> |
| 210 | + public void Start(AssemblyRunnerStartOptions startOptions = null) |
284 | 211 | { |
| 212 | + startOptions ??= AssemblyRunnerStartOptions.Empty; |
| 213 | + |
285 | 214 | lock (statusLock) |
286 | 215 | { |
287 | 216 | if (Status != AssemblyRunnerStatus.Idle) |
|
0 commit comments