Class UnitRunner

Description:

The UnitRunner class serves two main purposes:

The UnitRunner is an ActiveX control that can be embedded in a test project form. By adding instances of the TestContainers included in the test project, the user can select which test cases to run. The user can choose to run all test cases from all TestContainers, all test cases in a single TestContainer or a single test case.

When the UnitRunner is instructed to run it creates a TestSuite from the selected test case(s) and executes it. It can executed the test suite using a supplied TestResult object -- or it will create it's own TestResult if none is specified. The results of the tests are displayed in the grid as the test cases run. In accordance with standard unit testing guidelines, only failures and errors are reported. If nothing is reported for a test case, it is assumed that the test case executed successfully.

The progress bar reports the number of test cases that have been executed. The progress bar will remain green as long as no errors or failures have been encountered while executing the test cases. If an error or failure has occurred, the progress bar will turn from green to red. Unit tests are designed so that all tests should run successfully before the code is released. The green progress bar is used as an indication that all tests have passed successfully.

Interface Implementation:

Known Subclasses:

Method Summary:

Method:Definition:
AddTestContainer Public Function AddTestContainer(oTestContainer As ITestContainer)
Reset Public Sub Reset()
Run Public Sub Run(Optional oTestResult As TestResult)
SetDefaultTestContainer Public Sub SetDefaultTestContainer(oTestContainer As ITestContainer)
TestResult Public Property Get TestResult() As TestResult
Public Property Set TestResult(oTestResult As TestResult)
TestSuite Public Property Get TestSuite() As ITest

Methods:

TestSuite

Definition:
Public Property Get TestSuite() As ITest
Description:
Retrieve the TestSuite generated from the test cases that have been selected by the user.

TestResult

Definition:
Public Property Get TestResult() As TestResult
Public Property Set TestResult(oTestResult As TestResult)
Description:
Get/Set the TestResult to be used for capturing the results of running the tests.

AddTestContainer

Definition:
Public Function AddTestContainer(oTestContainer As ITestContainer)
Description:
Add a TestContainer to the UnitRunner so that the user can select test cases from it to execute.

Run

Definition:
Public Sub Run(Optional oTestResult As TestResult)
Description:
Run the test cases that have been selected by the user using the specified TestResult.

Reset

Definition:
Public Sub Reset()
Description:
Resets the UnitRunner control clearing the results of the last test run.

SetDefaultTestContainer

Definition:
Public Sub SetDefaultTestContainer(oTestContainer As ITestContainer)
Description:
Specify the TestContainer to be selected by default when the UnitRunner starts up.