C# 클래스 Microsoft.Silverlight.Testing.Harness.UnitTestHarness

A test harness for interacting with unit test providers such as Visual Studio Team Test's metadata.
파일 보기 프로젝트 열기: garyjohnson/wpnest 1 사용 예제들

공개 메소드들

메소드 설명
AddLogProvider ( Microsoft.Silverlight.Testing.Harness.LogProvider provider ) : void

Adds a log provider to the listening log providers group.

EnqueueTestAssembly ( Assembly assembly, TestRunFilter runFilter ) : void

Enqueue a test assembly from a simple Assembly reference.

EnqueueTestAssembly ( IAssembly testAssembly, TestRunFilter runFilter ) : void

Enqueues a test assembly.

Initialize ( ) : void

Initialize the harness with a set of test assemblies.

PrepareCustomTestInstance ( CustomFrameworkUnitTest customTest ) : void

Sets the unit test harness property for a test case that inherits from the abstract base type 'CustomTest'.

QueueLogMessage ( Microsoft.Silverlight.Testing.Harness.LogMessage message ) : void

Enqueue a log message object for processing by the log providers.

RestartRunDispatcher ( ) : void

Restarts the run dispatcher.

Run ( ) : void

Begin running the test harness.

Make sure to subscribe to the Complete event before calling this method, in some harnesses this may be a synchronous Run followed immediately by the Complete event being fired.

TrackScenarioResult ( ScenarioResult result ) : void

Track the results for our execution and also track the fail state.

UnitTestHarness ( ) : System

Initiate unit test harness.

WriteLogFile ( string logName, string fileContent ) : void

Stores a log file for the test run. Depending on the execution environment, this call may not successful.

보호된 메소드들

메소드 설명
CreateTestRunFilter ( UnitTestSettings settings ) : TestRunFilter

Creates the test run filter for the initial run.

OnIsDispatcherRunningChanged ( EventArgs e ) : void

Fires the play pause event.

OnPublishing ( EventArgs e ) : void

Call the Publishing event.

OnTestAssemblyCompleted ( TestAssemblyCompletedEventArgs e ) : void

Fires the test assembly completed event.

OnTestAssemblyStarting ( TestAssemblyStartingEventArgs e ) : void

Fires the test assembly starting event.

OnTestClassCompleted ( TestClassCompletedEventArgs e ) : void

Fires the test class completed event.

OnTestClassStarting ( TestClassStartingEventArgs e ) : void

Fires the test class starting event.

OnTestHarnessCompleted ( ) : void

Call the TestHarnessCompleted event.

OnTestMethodCompleted ( TestMethodCompletedEventArgs e ) : void

Notifies observers that a test method has been completed. Also clears the test panel's visual tree.

OnTestMethodStarting ( Microsoft.Silverlight.Testing.Harness.TestMethodStartingEventArgs e ) : void

Fires the test method starting event.

OnTestRunStarting ( TestRunStartingEventArgs e ) : void

Notifies observers that a test run has been started.

ProcessLogMessages ( ) : void

Process all queued log messages.

PublishFinalResult ( ) : void

If supported by any attached test service, this publishes the final test results. Typical harness implementations may immediately close the web browser channel upon receiving the message, so any other reporting should be done first.

PublishResults ( ) : void

Overrides the PublishResults method so that final reporting is only done once all other logging is finished.

RunNextStep ( ) : bool

Flush the current log manager and then perform the next invoke.

비공개 메소드들

메소드 설명
CalculateTotalMethods ( AssemblyManager assemblyManager, IAssembly assembly, TestRunFilter filter ) : int

Calculates the number of methods for a run.

CreateHarnessTasks ( ) : void

Creates the set of harness tasks to run and hooks up to the Complete event.

GlobalUnhandledExceptionListener ( object sender, EventArgs e ) : void

Listener event for any unhandled exceptions.

HarnessComplete ( object sender, EventArgs e ) : void

Event fired at the completion of the harness' work.

InitializeLogProviders ( ) : void

Initializes all log providers.

InitializeSettings ( UnitTestSettings settings ) : void

Fill member variables with any non-null settings of the same type.

IsReportingTestServiceConnected ( ) : bool

Checks if a reporting provider is connected to the test service.

PrepareTestAssemblyTasks ( ) : void

Determine what test assemblies need to be executed. Enqueue tasks for the unit test assembly providers to run the tests.

PublishFinalResults ( ) : void

Publish final results. If not yet ready, will keep waiting around as a work item until it is done.

ReportCodeCoverage ( TestServiceProvider testService ) : void
RunDispatcherComplete ( object sender, EventArgs e ) : void
SetOverallStatus ( string message ) : void

Immediately sets the overall status using a log message and processes the message queue.

메소드 상세

AddLogProvider() 공개 메소드

Adds a log provider to the listening log providers group.
public AddLogProvider ( Microsoft.Silverlight.Testing.Harness.LogProvider provider ) : void
provider Microsoft.Silverlight.Testing.Harness.LogProvider Log provider object.
리턴 void

CreateTestRunFilter() 보호된 메소드

Creates the test run filter for the initial run.
protected CreateTestRunFilter ( UnitTestSettings settings ) : TestRunFilter
settings UnitTestSettings The unit test settings.
리턴 TestRunFilter

EnqueueTestAssembly() 공개 메소드

Enqueue a test assembly from a simple Assembly reference.
public EnqueueTestAssembly ( Assembly assembly, TestRunFilter runFilter ) : void
assembly System.Reflection.Assembly The test assembly.
runFilter TestRunFilter The run filter settings for the test assembly's run.
리턴 void

EnqueueTestAssembly() 공개 메소드

Enqueues a test assembly.
public EnqueueTestAssembly ( IAssembly testAssembly, TestRunFilter runFilter ) : void
testAssembly IAssembly The test assembly metadata.
runFilter TestRunFilter The run filter settings for the test assembly's run.
리턴 void

Initialize() 공개 메소드

Initialize the harness with a set of test assemblies.
public Initialize ( ) : void
리턴 void

OnIsDispatcherRunningChanged() 보호된 메소드

Fires the play pause event.
protected OnIsDispatcherRunningChanged ( EventArgs e ) : void
e System.EventArgs Event data.
리턴 void

OnPublishing() 보호된 메소드

Call the Publishing event.
protected OnPublishing ( EventArgs e ) : void
e System.EventArgs The event arguments.
리턴 void

OnTestAssemblyCompleted() 보호된 메소드

Fires the test assembly completed event.
protected OnTestAssemblyCompleted ( TestAssemblyCompletedEventArgs e ) : void
e TestAssemblyCompletedEventArgs The event data.
리턴 void

OnTestAssemblyStarting() 보호된 메소드

Fires the test assembly starting event.
protected OnTestAssemblyStarting ( TestAssemblyStartingEventArgs e ) : void
e TestAssemblyStartingEventArgs The event data.
리턴 void

OnTestClassCompleted() 보호된 메소드

Fires the test class completed event.
protected OnTestClassCompleted ( TestClassCompletedEventArgs e ) : void
e TestClassCompletedEventArgs The event data.
리턴 void

OnTestClassStarting() 보호된 메소드

Fires the test class starting event.
protected OnTestClassStarting ( TestClassStartingEventArgs e ) : void
e TestClassStartingEventArgs The event data.
리턴 void

OnTestHarnessCompleted() 보호된 메소드

Call the TestHarnessCompleted event.
protected OnTestHarnessCompleted ( ) : void
리턴 void

OnTestMethodCompleted() 보호된 메소드

Notifies observers that a test method has been completed. Also clears the test panel's visual tree.
protected OnTestMethodCompleted ( TestMethodCompletedEventArgs e ) : void
e TestMethodCompletedEventArgs The event data.
리턴 void

OnTestMethodStarting() 보호된 메소드

Fires the test method starting event.
protected OnTestMethodStarting ( Microsoft.Silverlight.Testing.Harness.TestMethodStartingEventArgs e ) : void
e Microsoft.Silverlight.Testing.Harness.TestMethodStartingEventArgs The event data.
리턴 void

OnTestRunStarting() 보호된 메소드

Notifies observers that a test run has been started.
protected OnTestRunStarting ( TestRunStartingEventArgs e ) : void
e TestRunStartingEventArgs The event data.
리턴 void

PrepareCustomTestInstance() 공개 메소드

Sets the unit test harness property for a test case that inherits from the abstract base type 'CustomTest'.
public PrepareCustomTestInstance ( CustomFrameworkUnitTest customTest ) : void
customTest CustomFrameworkUnitTest A CustomText instance.
리턴 void

ProcessLogMessages() 보호된 메소드

Process all queued log messages.
protected ProcessLogMessages ( ) : void
리턴 void

PublishFinalResult() 보호된 메소드

If supported by any attached test service, this publishes the final test results. Typical harness implementations may immediately close the web browser channel upon receiving the message, so any other reporting should be done first.
protected PublishFinalResult ( ) : void
리턴 void

PublishResults() 보호된 메소드

Overrides the PublishResults method so that final reporting is only done once all other logging is finished.
protected PublishResults ( ) : void
리턴 void

QueueLogMessage() 공개 메소드

Enqueue a log message object for processing by the log providers.
public QueueLogMessage ( Microsoft.Silverlight.Testing.Harness.LogMessage message ) : void
message Microsoft.Silverlight.Testing.Harness.LogMessage The log message object.
리턴 void

RestartRunDispatcher() 공개 메소드

Restarts the run dispatcher.
public RestartRunDispatcher ( ) : void
리턴 void

Run() 공개 메소드

Begin running the test harness.
Make sure to subscribe to the Complete event before calling this method, in some harnesses this may be a synchronous Run followed immediately by the Complete event being fired.
public Run ( ) : void
리턴 void

RunNextStep() 보호된 메소드

Flush the current log manager and then perform the next invoke.
protected RunNextStep ( ) : bool
리턴 bool

TrackScenarioResult() 공개 메소드

Track the results for our execution and also track the fail state.
public TrackScenarioResult ( ScenarioResult result ) : void
result ScenarioResult Scenario result to process.
리턴 void

UnitTestHarness() 공개 메소드

Initiate unit test harness.
public UnitTestHarness ( ) : System
리턴 System

WriteLogFile() 공개 메소드

Stores a log file for the test run. Depending on the execution environment, this call may not successful.
public WriteLogFile ( string logName, string fileContent ) : void
logName string The name of the log file.
fileContent string The log file content as a string.
리턴 void