Table of Contents

Class TestWorker

Namespace
NUnit.Framework.Internal.Execution
Assembly
nunit.framework.dll

A TestWorker pulls work items from a queue and executes them.

public class TestWorker
Inheritance
TestWorker
Inherited Members

Constructors

TestWorker(WorkItemQueue, string)

Construct a new TestWorker.

public TestWorker(WorkItemQueue queue, string name)

Parameters

queue WorkItemQueue

The queue from which to pull work items

name string

The name of this worker

Properties

IsAlive

Indicates whether the worker thread is running

public bool IsAlive { get; }

Property Value

bool

Name

The name of this worker - also used for the thread

public string Name { get; }

Property Value

string

WorkQueue

The WorkItemQueue from which this worker pulls WorkItems

public WorkItemQueue WorkQueue { get; }

Property Value

WorkItemQueue

Methods

Cancel(bool)

Stop the thread, either immediately or after finishing the current WorkItem

public void Cancel(bool force)

Parameters

force bool

true if the thread should be aborted, false if it should allow the currently running test to complete

Start()

Create thread and start processing work items.

public void Start()

Events

Busy

Event signaled immediately before executing a WorkItem

public event TestWorker.TestWorkerEventHandler? Busy

Event Type

TestWorker.TestWorkerEventHandler

Idle

Event signaled immediately after executing a WorkItem

public event TestWorker.TestWorkerEventHandler? Idle

Event Type

TestWorker.TestWorkerEventHandler