C# 클래스 Microsoft.Silverlight.Testing.WorkItemTest

Custom test class that provides the ability to perform semi-asynchronous test tasks on the main thread. Requires the custom unit test harness that manages and invokes test work items on the thread when needed. Tests using this functionality will not be compatible with the full desktop framework's Visual Studio Team Test environment.
파일 보기 프로젝트 열기: garyjohnson/wpnest 1 사용 예제들

공개 메소드들

메소드 설명
EnqueueCallback ( ) : void

Adds a number of callback methods into the test task queue.

EnqueueCallback ( System.Action testCallbackDelegate ) : void

Add a Callback method into the test task queue. Similar to the PumpMessages(...) call, with the difference being that there is no longer a single requirement: you can enqueue several callback methods and other test tasks, all of which will execute before the test completes and/or the engine continues.

EnqueueConditional ( Func conditionalDelegate ) : void

Requires a bool returning delegate to be passed in. Instructs the test task queue to wait until the conditional call returns True to continue executing other test tasks and/or ending the test method.

EnqueueDelay ( System.TimeSpan delay ) : void

Delay a minimum amount of time before continuing. Similar to a sleep call that is not a blocking call.

EnqueueDelay ( double milliseconds ) : void

Delay a minimum amount of time before continuing. Similar to a sleep call that is not a blocking call.

EnqueueTestComplete ( ) : void

Enqueue a test task which calls the TestComplete method of SilverlightTest.

EnqueueWorkItem ( WorkItem testTaskObject ) : void

Add a task object to the test queue. For a test that is currently executing, all tasks contained within the queue are executed to completion (unless an Exception is thrown) -before- moving on to the next test. The test task queue replaces the PumpMessages(...) system that permitted a single callback. This enables specialized tasks, such as DOM bridge tasks, sleep tasks, and conditional continue tasks.

TestComplete ( ) : void

Signal that a test is complete when using Async testing. WARNING: If you use your own methods for completing, such as an HtmlTimer or other threading method, it is possible that this call will occur *AFTER* the test has timed out when using Timeouts. As such, be very careful as you could complete the call to the *next* test.

비공개 메소드들

메소드 설명
CreateCallback ( System.Action testCallbackDelegate ) : WorkItem
CreateConditional ( Func conditionalDelegate ) : WorkItem
CreateDelay ( System.TimeSpan delay ) : WorkItem
Enqueue ( System.Action action ) : void
EnqueueSleep ( int sleepMillisecondsMinimum ) : void
Sleep ( int sleepMillisecondsMinimum, System.Action testCallback ) : void

메소드 상세

EnqueueCallback() 공개 메소드

Adds a number of callback methods into the test task queue.
public EnqueueCallback ( ) : void
리턴 void

EnqueueCallback() 공개 메소드

Add a Callback method into the test task queue. Similar to the PumpMessages(...) call, with the difference being that there is no longer a single requirement: you can enqueue several callback methods and other test tasks, all of which will execute before the test completes and/or the engine continues.
public EnqueueCallback ( System.Action testCallbackDelegate ) : void
testCallbackDelegate System.Action Void-returning delegate, /// anonymous delegates work fine too.
리턴 void

EnqueueConditional() 공개 메소드

Requires a bool returning delegate to be passed in. Instructs the test task queue to wait until the conditional call returns True to continue executing other test tasks and/or ending the test method.
public EnqueueConditional ( Func conditionalDelegate ) : void
conditionalDelegate Func Conditional method or delegate. /// Test will halt until this condition returns True.
리턴 void

EnqueueDelay() 공개 메소드

Delay a minimum amount of time before continuing. Similar to a sleep call that is not a blocking call.
public EnqueueDelay ( System.TimeSpan delay ) : void
delay System.TimeSpan The minimum time span to wait before continuing.
리턴 void

EnqueueDelay() 공개 메소드

Delay a minimum amount of time before continuing. Similar to a sleep call that is not a blocking call.
public EnqueueDelay ( double milliseconds ) : void
milliseconds double The minimum number of milliseconds to wait /// until the delay is finished.
리턴 void

EnqueueTestComplete() 공개 메소드

Enqueue a test task which calls the TestComplete method of SilverlightTest.
public EnqueueTestComplete ( ) : void
리턴 void

EnqueueWorkItem() 공개 메소드

Add a task object to the test queue. For a test that is currently executing, all tasks contained within the queue are executed to completion (unless an Exception is thrown) -before- moving on to the next test. The test task queue replaces the PumpMessages(...) system that permitted a single callback. This enables specialized tasks, such as DOM bridge tasks, sleep tasks, and conditional continue tasks.
public EnqueueWorkItem ( WorkItem testTaskObject ) : void
testTaskObject WorkItem Asynchronous test task /// instance.
리턴 void

TestComplete() 공개 메소드

Signal that a test is complete when using Async testing. WARNING: If you use your own methods for completing, such as an HtmlTimer or other threading method, it is possible that this call will occur *AFTER* the test has timed out when using Timeouts. As such, be very careful as you could complete the call to the *next* test.
public TestComplete ( ) : void
리턴 void