C# Class Testeroids.TplTestPlatformHelper.TestTaskScheduler

Provides a task scheduler that runs tasks only on the current thread, and records the order in which Tasks were queued using QueueTask.
Inheritance: System.Threading.Tasks.TaskScheduler
显示文件 Open project: Testeroids/Testeroids Class Usage Examples

Private Properties

Property Type Description

Public Methods

Method Description
TestTaskScheduler ( bool executeTplTasks ) : System

Initializes a new instance of the TestTaskScheduler class.

Protected Methods

Method Description
GetScheduledTasks ( ) : IEnumerable

Gets the Tasks currently scheduled to this scheduler.

QueueTask ( System.Threading.Tasks.Task task ) : void

Runs the provided Task synchronously on the current thread.

TryExecuteTaskInline ( System.Threading.Tasks.Task task, bool taskWasPreviouslyQueued ) : bool

Runs the provided Task synchronously on the current thread.

Method Details

GetScheduledTasks() protected method

Gets the Tasks currently scheduled to this scheduler.
protected GetScheduledTasks ( ) : IEnumerable
return IEnumerable

QueueTask() protected method

Runs the provided Task synchronously on the current thread.
protected QueueTask ( System.Threading.Tasks.Task task ) : void
task System.Threading.Tasks.Task The task to be executed.
return void

TestTaskScheduler() public method

Initializes a new instance of the TestTaskScheduler class.
public TestTaskScheduler ( bool executeTplTasks ) : System
executeTplTasks bool /// Setting this field to false will prevent any queued task from starting. ///
return System

TryExecuteTaskInline() protected method

Runs the provided Task synchronously on the current thread.
protected TryExecuteTaskInline ( System.Threading.Tasks.Task task, bool taskWasPreviouslyQueued ) : bool
task System.Threading.Tasks.Task The task to be executed.
taskWasPreviouslyQueued bool Whether the Task was previously queued to the scheduler.
return bool