NUnit.Framework.Internal.Execution.WorkItem
A WorkItem may be an individual test case, a fixture or
a higher level grouping of tests. All WorkItems inherit
from the abstract WorkItem class, which uses the template
pattern to allow derived classes to perform work in
whatever way is needed.
A WorkItem is created with a particular TestExecutionContext
and is responsible for re-establishing that context in the
current thread before it begins or resumes execution.
namespace NUnit.Framework.Internal.Execution
{
public abstract class WorkItem : IDisposable
{
public WorkItemState State { get; set; }
public Test Test { get; }
public virtual string Name { get; }
public ITestFilter Filter { get; }
public TestExecutionContext Context { get; }
public TestWorker TestWorker { get; }
public virtual ParallelExecutionStrategy ExecutionStrategy { get; }
public virtual bool IsolateChildTests { get; }
public TestResult Result { get; set; }
public ParallelScope ParallelScope { get; }
public event EventHandler Completed;
public WorkItem(Test test, ITestFilter filter);
public WorkItem(WorkItem wrappedItem);
public void InitializeContext(TestExecutionContext context);
public virtual void Execute();
public void WaitForCompletion();
public void MarkNotRunnable(string reason);
public virtual void Cancel(bool force);
public void Dispose();
protected abstract void PerformWork();
protected void WorkItemComplete();
protected List<SetUpTearDownItem> BuildSetUpTearDownList(IMethodInfo[] setUpMethods, IMethodInfo[] tearDownMethods, IMethodValidator methodValidator = null);
protected void ChangeResult(ResultState resultState, string message);
}
}