Package | flexunit.framework |
Class | public class TestCase |
Inheritance | TestCase Assert |
Implements | Test |
Subclasses | EventfulTestCase, WarningTestCase |
See also
Property | Defined by | ||
---|---|---|---|
assertionsMade : Number | TestCase | ||
assetionsMade : Number [static]
| Assert | ||
className : String [read-only]
Returns the the fully qualified class name
| TestCase | ||
maxAssertionsMade : Number [static]
| Assert | ||
methodName : String
The method name of the individual test to be run
| TestCase | ||
totalAssertionsMade : Number [static]
| Assert |
Method | Defined by | ||
---|---|---|---|
TestCase(methodName:String = null)
The TestCase constructor.
| TestCase | ||
addAsync(func:Function, timeout:int, passThroughData:Object = null, failFunc:Function = null):Function
Add an asynchronous check point to the test.
| TestCase | ||
assertContained(... rest):void
[static]
Asserts that the first string is contained in the second one
The first argument can be the message when the assertion fails
| Assert | ||
assertEquals(... rest):void
[static]
Asserts that 2 values are equal.
| Assert | ||
assertFalse(... rest):void
[static]
Asserts that a condition is false
The first argument can be the message when the assertion fails
| Assert | ||
assertMatch(... rest):void
[static]
Asserts that a string matches a regexp.
| Assert | ||
assertNoMatch(... rest):void
[static]
Asserts that a string doesn't match a regexp.
| Assert | ||
assertNotContained(... rest):void
[static]
Asserts that the first string is not contained in the second one
The first argument can be the message when the assertion fails
| Assert | ||
assertNotNull(... rest):void
[static]
Asserts that an object is not null
The first argument can be the message when the assertion fails
| Assert | ||
assertNotUndefined(... rest):void
[static]
Asserts that an object is not undefined
The first argument can be the message when the assertion fails
| Assert | ||
assertNull(... rest):void
[static]
Asserts that an object is null
The first argument can be the message when the assertion fails
| Assert | ||
assertStrictlyEquals(... rest):void
[static]
Asserts that two objects are strickly identical
The first argument can be the message when the assertion fails
| Assert | ||
assertTrue(... rest):void
[static]
Asserts that a condition is true
The first argument can be the message when the assertion fails
| Assert | ||
assertUndefined(... rest):void
[static]
Asserts that an object is undefined
The first argument can be the message when the assertion fails
| Assert | ||
countTestCases():Number
The number of test cases in this test class.
| TestCase | ||
fail(failMessage:String = ""):void
[static]
Fails with the given message
| Assert | ||
getNextAsync():Object
The AsyncTestHelper will call this when it's ready for to start the next async.
| TestCase | ||
getTestMethodNames():Array
| TestCase | ||
hasAsync():Boolean
Returns true if there are any asynchronous methods remaining to be called
| TestCase | ||
oneAssertionHasBeenMade():void
[static]
| Assert | ||
resetAssertionsMade():void
[static]
| Assert | ||
resetEveryAsserionsFields():void
[static]
| Assert | ||
Creates a new
TestResult and runs the tests, populating that TestResult
with the results. | TestCase | ||
runFinish():void
Runs
tearDown()
| TestCase | ||
runMiddle():void
Runs the normal test method or the next asynchronous method
| TestCase | ||
runStart():void
Runs
setUp()
| TestCase | ||
runWithResult(result:TestResult):void
Runs the tests, populating the
result parameter. | TestCase | ||
setTestResult(result:TestResult):void
Called by the TestResult to pass along so that it can be passed for async
| TestCase | ||
setUp():void
Empty implementation of
setUp() . | TestCase | ||
startAsync():void
Called by the TestResult to kick off wait for the next asynchronous method
| TestCase | ||
tearDown():void
Empty implementation of
tearDown() . | TestCase | ||
toString():String
A string representation of the test case
| TestCase |
assertionsMade | property |
assertionsMade:Number
[read-write]Implementation
public function get assertionsMade():Number
public function set assertionsMade(value:Number):void
className | property |
className:String
[read-only]Returns the the fully qualified class name
Implementation public function get className():String
methodName | property |
public var methodName:String
The method name of the individual test to be run
TestCase | () | constructor |
public function TestCase(methodName:String = null)
The TestCase constructor. If you provide a contstructor in a TestCase
subclass,
you should ensure that this constructor is called.
methodName:String (default = null ) — name of the test method to be called in the test run.
|
addAsync | () | method |
public function addAsync(func:Function, timeout:int, passThroughData:Object = null, failFunc:Function = null):Function
Add an asynchronous check point to the test. This method will return an event handler function.
Parametersfunc:Function — the Function to execute when things have been handled
|
|
timeout:int — if the function isn't called within this time the test is considered a failure
|
|
passThroughData:Object (default = null ) — data that will be passed to your function (only if non-null) as the 2nd argument
|
|
failFunc:Function (default = null ) — a Function that will be called if the asynchronous function fails to execute, useful if perhaps the failure to
execute was intentional or if you want a specific failure message
|
Function — the Function that can be used as an event listener
|
countTestCases | () | method |
public function countTestCases():Number
The number of test cases in this test class.
ReturnsNumber — A Number representation the count of test cases in this test class. Always returns 1 for TestCase
|
getNextAsync | () | method |
public function getNextAsync():Object
The AsyncTestHelper will call this when it's ready for to start the next async. It's possible that it will need to get access to it even before async has been started if the call didn't actually end up being asynchronous.
ReturnsObject |
getTestMethodNames | () | method |
public function getTestMethodNames():Array
Returns
Array |
hasAsync | () | method |
public function hasAsync():Boolean
Returns true if there are any asynchronous methods remaining to be called
ReturnsBoolean |
run | () | method |
public function run():TestResult
Creates a new TestResult
and runs the tests, populating that TestResult
with the results.
TestResult |
runFinish | () | method |
public function runFinish():void
Runs tearDown()
runMiddle | () | method |
public function runMiddle():void
Runs the normal test method or the next asynchronous method
runStart | () | method |
public function runStart():void
Runs setUp()
runWithResult | () | method |
public function runWithResult(result:TestResult):void
Runs the tests, populating the result
parameter.
result:TestResult — TestResult instance to be populated
|
setTestResult | () | method |
public function setTestResult(result:TestResult):void
Called by the TestResult to pass along so that it can be passed for async
Parametersresult:TestResult |
setUp | () | method |
public function setUp():void
Empty implementation of setUp()
. Can be overridden in test class.
startAsync | () | method |
public function startAsync():void
Called by the TestResult to kick off wait for the next asynchronous method
tearDown | () | method |
public function tearDown():void
Empty implementation of tearDown()
. Can be overridden in test class.
toString | () | method |
public function toString():String
A string representation of the test case
ReturnsString — A string representation of the test class name and the test method name.
|