NUnit.Framework.Internal.Execution.WorkShift
The dispatcher needs to do different things at different,
non-overlapped times. For example, non-parallel tests may
not be run at the same time as parallel tests. We model
this using the metaphor of a working shift. The WorkShift
class associates one or more WorkItemQueues with one or
more TestWorkers.
Work in the queues is processed until all queues are empty
and all workers are idle. Both tests are needed because a
worker that is busy may end up adding more work to one of
the queues. At that point, the shift is over and another
shift may begin. This cycle continues until all the tests
have been run.
namespace NUnit.Framework.Internal.Execution
{
public class WorkShift
{
public string Name { get; }
public bool IsActive { get; }
public bool HasWork { get; }
public event ShiftChangeEventHandler EndOfShift;
public WorkShift(string name);
public void AddQueue(WorkItemQueue queue);
public void Assign(TestWorker worker);
public void Start();
public void EndShift();
public void ShutDown();
public void Cancel(bool force);
}
}