The TestResult object collects the results from executing test cases. It is an instance of the Collecting Parameter pattern. When new failures or errors are added to the TestResult or if a test case is started or finished, the TestResult generates events to notify its event handlers about what has happened.
The test framework distinguishes between failures and errors. A failure is anticipated and checked for with assertions. Errors are unanticipated problems signified by errors that are raised while executing the test code. TestResult includes a set of Assert methods that simplify the checking of test assertions.
Method: | Definition: |
---|---|
Assert | Public Sub Assert(bCondition As Boolean, Optional sMessage As String) |
AssertEqualsDouble | Public Sub AssertEqualsDouble(dExpected As Double, dActual As Double, dDelta As Double, Optional sMessage As String) |
AssertEqualsError | Public Sub AssertEqualsError(oError As ErrObject, Optional lError As Long, Optional sMessage As String) |
AssertEqualsLong | Public Sub AssertEqualsLong(lExpected As Long, lActual As Long, Optional sMessage As String) |
AssertEqualsObject | Public Sub AssertEqualsObject(oExpected As Object, oActual As Object, Optional sMessage As String) |
AssertEqualsString | Public Sub AssertEqualsString(sExpected As String, sActual As String, Optional sMessage As String) |
AssertEqualsVariant | Public Sub AssertEqualsVariant(vExpected As Variant, vActual As Variant, Optional sMessage As String) |
AssertExists | Public Sub AssertExists(oObject As Object, Optional sMessage As String) |
AssertNotEmpty | Public Sub AssertNotEmpty(vVariant As Variant, Optional sMessage As String) |
AssertNotNull | Public Sub AssertNotNull(vVariant As Variant, Optional sMessage As String) |
AddError | Public Sub AddError(lNumber As Long, sSource As String, sDescription As String) |
AddFailure | Public Sub AddFailure(sDescription As String) |
AddTrace | Public Sub AddTrace(sMessage As String) |
EndTest | Public Sub EndTest() |
Errors | Public Property Get Errors() As TestErrors |
Failures | Public Property Get Failures() As TestErrors |
Parameters | Public Property Get Parameters() As TestParameters Public Property Set Parameters(colParameters As TestParameters) |
Run | Public Sub Run(ByRef oTestResult As TestResult) |
RunTests | Public Property Get RunTests() As Integer |
StartTest | Public Sub StartTest(oTestCase As ITestCase) |
WasSuccessful | Public Property Get WasSuccessful() As Boolean |
Event: | Definition: |
---|---|
AfterStartTest | Public Event AfterStartTest(oTestCase As ITestCase) |
AfterEndTest | Public Event AfterEndTest() |
AfterAddError | Public Event AfterAddError(oError As TestError) |
AfterAddFailure | Public Event AfterAddFailure(oError As TestError) |
AfterAddTrace | Public Event AfterAddTrace(sMessage As String) |