Packageorg.flexunit
Classpublic class Assert
InheritanceAssert Inheritance Object
Subclasses UIImpersonator

A set of assert methods. Messages are only displayed when an assert fails.



Public Properties
 PropertyDefined By
  assertionsMade : uint
[static] [read-only] Returns the number of assertions that have been made
Assert
Public Methods
 MethodDefined By
  
assertEquals(... rest):void
[static] Asserts that two provided values are equal.
Assert
  
assertFalse(... rest):void
[static] Asserts that a condition is false.
Assert
  
assertNotNull(... rest):void
[static] Asserts that an object is not null.
Assert
  
assertNull(... rest):void
[static] Asserts that an object is null.
Assert
  
assertStrictlyEquals(... rest):void
[static] / Asserts that the provided values are strictly equal.
Assert
  
assertTrue(... rest):void
[static] Asserts that a condition is true.
Assert
  
fail(failMessage:String):void
[static] Fails a test with the argument message.
Assert
  
failNotNull(message:String, object:Object):void
[static] Asserts that an object is not null.
Assert
  
failNotTrue(message:String, condition:Boolean):void
[static] Asserts that a condition is not true.
Assert
  
failNull(message:String, object:Object):void
[static] Asserts that an object is not null.
Assert
  
failTrue(message:String, condition:Boolean):void
[static] Asserts that a condition is false.
Assert
  
[static] Resets the count for the number of assertions that have been made back to zero
Assert
Property Detail
assertionsMadeproperty
assertionsMade:uint  [read-only]

Returns the number of assertions that have been made


Implementation
    public static function get assertionsMade():uint
Method Detail
assertEquals()method
public static function assertEquals(... rest):void

Asserts that two provided values are equal.

Parameters

... rest — The function to use for assertion.

assertFalse()method 
public static function assertFalse(... rest):void

Asserts that a condition is false.

Parameters

... rest — Accepts an argument of type Boolean. If two arguments are passed the first argument must be a String and will be used as the error message. assertFalse( String, Boolean ); assertFalse( Boolean );

assertNotNull()method 
public static function assertNotNull(... rest):void

Asserts that an object is not null.

Parameters

... rest — Accepts an argument of type Object. If two arguments are passed the first argument must be a String and will be used as the error message. assertNotNull( String, Object ); assertNotNull( Object );

assertNull()method 
public static function assertNull(... rest):void

Asserts that an object is null.

Parameters

... rest — Accepts an argument of type Object. If two arguments are passed the first argument must be a String and will be used as the error message. assertNull( String, Object ); assertNull( Object );

assertStrictlyEquals()method 
public static function assertStrictlyEquals(... rest):void

/ Asserts that the provided values are strictly equal.

Parameters

... rest — Must be passed at least 2 arguments of type Object to compare for strict equality. If three arguments are passed, the first argument must be a String and will be used as the error message. assertStrictlyEquals( String, Object, Object ); assertStrictlyEquals( Object, Object );

assertTrue()method 
public static function assertTrue(... rest):void

Asserts that a condition is true.

Parameters

... rest — Accepts an argument of type Boolean. If two arguments are passed the first argument must be a String and will be used as the error message. assertTrue( String, Boolean ); assertTrue( Boolean );

fail()method 
public static function fail(failMessage:String):void

Fails a test with the argument message.

Parameters

failMessage:String — the identifying message for the AssertionFailedError (null okay)

See also

AssertionFailedError
failNotNull()method 
public static function failNotNull(message:String, object:Object):void

Asserts that an object is not null.

Parameters

message:String — Accepts an argument of type Boolean. If two arguments are passed the first argument must be a String and will be used as the error message. assertTrue( String, Boolean ); assertTrue( Boolean );
 
object:Object

failNotTrue()method 
public static function failNotTrue(message:String, condition:Boolean):void

Asserts that a condition is not true.

Parameters

message:String — Accepts an argument of type Boolean. If two arguments are passed the first argument must be a String and will be used as the error message. assertTrue( String, Boolean ); assertTrue( Boolean );
 
condition:Boolean

failNull()method 
public static function failNull(message:String, object:Object):void

Asserts that an object is not null.

Parameters

message:String — Accepts an argument of type Boolean. If two arguments are passed the first argument must be a String and will be used as the error message. assertTrue( String, Boolean ); assertTrue( Boolean );
 
object:Object

failTrue()method 
public static function failTrue(message:String, condition:Boolean):void

Asserts that a condition is false.

Parameters

message:String — Accepts an argument of type Boolean. If two arguments are passed the first argument must be a String and will be used as the error message. assertTrue( String, Boolean ); assertTrue( Boolean );
 
condition:Boolean

resetAssertionsFields()method 
public static function resetAssertionsFields():void

Resets the count for the number of assertions that have been made back to zero