| Package | asunit.framework |
| Class | public class TestResult |
| Implements | TestListener |
TestResult collects the results of executing
a test case. It is an instance of the Collecting Parameter pattern.
The test framework distinguishes between failures and errors.
A failure is anticipated and checked for with assertions. Errors are
unanticipated problems like an ArrayIndexOutOfBoundsException.
See also
| Property | Defined by | ||
|---|---|---|---|
| fErrors : Array | TestResult | ||
| fFailures : Array | TestResult | ||
| fListeners : Array | TestResult | ||
| fRunTests : int | TestResult | ||
| Method | Defined by | ||
|---|---|---|---|
| TestResult | |||
|
Adds an error to the list of errors.
| TestResult | ||
|
Adds a failure to the list of failures.
| TestResult | ||
|
addListener(listener:TestListener):void
Registers a TestListener
| TestResult | ||
|
Informs the result that a test was completed.
| TestResult | ||
|
endTestMethod(test:Test, method:String):void
| TestResult | ||
|
errorCount():int
Gets the number of detected errors.
| TestResult | ||
|
errors():Array
Returns an Enumeration for the errors
| TestResult | ||
|
failureCount():int
Gets the number of detected failures.
| TestResult | ||
|
failures():Array
Returns an Enumeration for the failures
| TestResult | ||
|
removeListener(listener:TestListener):void
Unregisters a TestListener
| TestResult | ||
|
Runs a TestCase.
| TestResult | ||
|
runCount():int
Gets the number of run tests.
| TestResult | ||
|
shouldStop():Boolean
Checks whether the test run should stop
| TestResult | ||
|
Informs the result that a test will be started.
| TestResult | ||
|
startTestMethod(test:Test, method:String):void
| TestResult | ||
|
stop():void
Marks that the test run should stop.
| TestResult | ||
|
wasSuccessful():Boolean
Returns whether the entire test was successful or not.
| TestResult | ||
| fErrors | property |
protected var fErrors:Array
| fFailures | property |
protected var fFailures:Array
| fListeners | property |
protected var fListeners:Array
| fRunTests | property |
protected var fRunTests:int
| TestResult | () | constructor |
public function TestResult()
| addError | () | method |
public function addError(test:Test, t:Error):voidAdds an error to the list of errors. The passed in exception caused the error.
Parameterstest:Test |
|
t:Error |
| addFailure | () | method |
public function addFailure(test:Test, t:AssertionFailedError):voidAdds a failure to the list of failures. The passed in exception caused the failure.
Parameterstest:Test |
|
t:AssertionFailedError |
| addListener | () | method |
public function addListener(listener:TestListener):voidRegisters a TestListener
Parameterslistener:TestListener |
| endTest | () | method |
public function endTest(test:Test):voidInforms the result that a test was completed.
Parameterstest:Test |
| endTestMethod | () | method |
| errorCount | () | method |
public function errorCount():intGets the number of detected errors.
Returnsint |
| errors | () | method |
public function errors():ArrayReturns an Enumeration for the errors
ReturnsArray |
| failureCount | () | method |
public function failureCount():intGets the number of detected failures.
Returnsint |
| failures | () | method |
public function failures():ArrayReturns an Enumeration for the failures
ReturnsArray |
| removeListener | () | method |
public function removeListener(listener:TestListener):voidUnregisters a TestListener
Parameterslistener:TestListener |
| run | () | method |
| runCount | () | method |
public function runCount():intGets the number of run tests.
Returnsint |
| shouldStop | () | method |
public function shouldStop():BooleanChecks whether the test run should stop
ReturnsBoolean |
| startTest | () | method |
public function startTest(test:Test):voidInforms the result that a test will be started.
Parameterstest:Test |
| startTestMethod | () | method |
| stop | () | method |
public function stop():voidMarks that the test run should stop.
| wasSuccessful | () | method |
public function wasSuccessful():BooleanReturns whether the entire test was successful or not.
ReturnsBoolean |