Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
jnm2 committed May 17, 2020
1 parent 77841bc commit 2060698
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/NUnitEngine/nunit.engine.core/AsyncTestEngineResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
// ***********************************************************************

using System;
using System.ComponentModel;
using System.Threading;
using System.Xml;
using NUnit.Common;
Expand All @@ -44,13 +43,7 @@ public class AsyncTestEngineResult : ITestRun
public static AsyncTestEngineResult RunAsync(Func<TestEngineResult> func)
{
var testRun = new AsyncTestEngineResult();

using (var worker = new BackgroundWorker())
{
worker.DoWork += (sender, e) => testRun.SetResult(func.Invoke());
worker.RunWorkerAsync();
}

ThreadPool.QueueUserWorkItem(_ => testRun.SetResult(func.Invoke()));
return testRun;
}
#endif
Expand Down

0 comments on commit 2060698

Please sign in to comment.