Packageasunit.framework
Classpublic class TestSuite
InheritanceTestSuite Inheritance TestCase Inheritance Assert Inheritance flash.events.EventDispatcher
ImplementsTest

A TestSuite is a Composite of Tests.

View the examples.

See also

Test
TestCase


Protected Properties
 PropertyDefined by
 Inheritedcontext : DisplayObjectContainer
TestCase
 InheritedfName : String
TestCase
 InheritedisComplete : Boolean
TestCase
 Inheritedresult : TestListener
TestCase
 InheritedtestMethods : Array
TestCase
Public Methods
 MethodDefined by
  
TestSuite
  
addTest(test:Test):void
Adds a test instance to the suite.
TestSuite
 Inherited
assertEquals(... args):void
[static] Asserts that two objects are equal.
Assert
 Inherited
assertEqualsArrays(... args):void
[static] Asserts that two arrays have the same length and contain the same objects in the same order.
Assert
 Inherited
[static] Asserts that two arrays have the same length and contain the same objects.
Assert
 Inherited
assertEqualsFloat(... args):void
[static] Asserts that two numerical values are equal within a tolerance range.
Assert
 Inherited
assertFalse(... args):void
[static] Asserts that a condition is false.
Assert
 Inherited
assertNotNull(... args):void
[static] Asserts that an object isn't null.
Assert
 Inherited
assertNotSame(... args):void
[static] Asserts that two objects do not refer to the same object.
Assert
 Inherited
assertNull(... args):void
[static] Asserts that an object is null.
Assert
 Inherited
assertSame(... args):void
[static] Asserts that two objects refer to the same object.
Assert
 Inherited
assertThrows(errorType:Class, block:Function):void
[static] Asserts that the provided block throws an exception that matches the type provided.
Assert
 Inherited
assertTrue(... args):void
[static] Asserts that a condition is true.
Assert
 Inherited
TestCase
 Inherited
asyncOperationTimeout(async:AsyncOperation, duration:Number):void
TestCase
  
Counts the number of tests that will be run by this Suite.
TestSuite
 Inherited
fail(message:String):void
[static] Fails a test with the given message.
Assert
 Inherited
getContext():DisplayObjectContainer
Returns the visual DisplayObjectContainer that will be used by addChild and removeChild helper methods.
TestCase
 Inherited
TestCase
  
getIsComplete():Boolean
TestSuite
 Inherited
getName():String
Gets the name of a TestCase
TestCase
 Inherited
TestCase
 Inherited
TestCase
  
run():void
Runs the tests and collects their result in a TestResult.
TestSuite
 Inherited
runBare():void
Runs the bare test sequence.
TestCase
  
setContext(context:DisplayObjectContainer):void
TestSuite
 Inherited
setName(name:String):void
Sets the name of a TestCase
TestCase
 Inherited
setResult(result:TestListener):void
TestCase
  
testCount():int
Returns the number of tests in this suite
TestSuite
  
toString():String
TestSuite
Protected Methods
 MethodDefined by
 Inherited
addAsync(handler:Function = null, duration:Number):Function
Called from within setUp or the body of any test method.
TestCase
 Inherited
addChild(child:DisplayObject):DisplayObject
Helper method for testing DisplayObjects.
TestCase
 Inherited
cleanUp():void
Override this method in Asynchronous test cases or any other time you want to perform additional member cleanup after all test methods have run
TestCase
 Inherited
Creates a default TestResult object
TestCase
 Inherited
removeChild(child:DisplayObject):DisplayObject
Helper method for removing added DisplayObjects.
TestCase
 Inherited
runTearDown():void
TestCase
  
setTestMethods(methodNodes:XMLList):void
TestSuite
 Inherited
setUp():void
Sets up the fixture, for example, instantiate a mock object.
TestCase
 Inherited
tearDown():void
Tears down the fixture, for example, delete mock object.
TestCase
Protected Constants
 ConstantDefined by
 InheritedDEFAULT_TIMEOUT : int = 1000
[static]
TestCase
 InheritedPRE_SET_UP : int = 0
[static]
TestCase
 InheritedRUN_METHOD : int = 2
[static]
TestCase
 InheritedSET_UP : int = 1
[static]
TestCase
 InheritedTEAR_DOWN : int = 3
[static]
TestCase
Constructor detail
TestSuite()constructor
public function TestSuite()
Method detail
addTest()method
public function addTest(test:Test):void

Adds a test instance to the suite.

Parameters
test:Test
countTestCases()method 
public override function countTestCases():int

Counts the number of tests that will be run by this Suite.

Returns
int
getIsComplete()method 
public override function getIsComplete():Boolean

Returns
Boolean
run()method 
public override function run():void

Runs the tests and collects their result in a TestResult.

setContext()method 
public override function setContext(context:DisplayObjectContainer):voidParameters
context:DisplayObjectContainer
setTestMethods()method 
protected override function setTestMethods(methodNodes:XMLList):voidParameters
methodNodes:XMLList
testCount()method 
public function testCount():int

Returns the number of tests in this suite

Returns
int
toString()method 
public override function toString():String

Returns
String
Examples

package {
    import asunit.framework.TestSuite;
    import errors.CustomErrorTest;
    import net.CustomRequestTest;
    import net.CustomServiceTest;

    public class AllTests extends TestSuite {

        public function AllTests() {
            addTest(new errors.CustomErrorTest());
            addTest(new net.CustomRequestTest());
            addTest(new net.CustomServiceTest());
        }
    }
}