Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
Dragengine.TestSystem.TestCase Class Reference

Test Case. More...

Inheritance diagram for Dragengine.TestSystem.TestCase:
Dragengine.TestSystem.TestCaseECBehavior Dragengine.TestSystem.TestCaseECBehaviorPersistency

Classes

enum  State
 Test State. More...

Public Member Functions

void assertColor (Color found, Color expected, float range)
 Fail test if colors are not equal within range.
void assertDiffers (Object found, Object shouldNot)
 Fail test if found equals expected.
void assertDVector (DVector found, DVector expected)
 Fail test if vectors are not equal within range of 1mm.
void assertDVector (DVector found, DVector expected, float range)
 Fail test if vectors are not equal within range.
void assertEquals (Object found, Object expected)
 Fail test if found does not equal expected.
void assertFalse (bool found)
 Fail test if found is not false.
void assertNotNull (Object found)
 Fail test if found is not null.
void assertNull (Object found)
 Fail test if found is not null.
void assertQuaternion (Quaternion found, Quaternion expected)
 Fail test if quaternions are not equal within range of 1mm.
void assertQuaternion (Quaternion found, Quaternion expected, float range)
 Fail test if quaternions are not equal within range.
void assertThrows (Block ablock)
 Fail test if ablock does not throw an exception.
void assertTrue (bool found)
 Fail test if found is not true.
void assertVector (DVector found, DVector expected, float range)
 Fail test if vectors are not equal within range.
void assertVector (Vector found, Vector expected)
 Fail test if vectors are not equal within range of 1mm.
bool getEnabled ()
 Test case is enabled.
Exception getException ()
 Exception if test case failed.
String getID ()
 Identifier.
UnicodeString getName ()
 Display name.
State getState ()
 Test state.
TestSuite getTestSuite ()
 Test suite.
void init ()
 Initialize test.
TestCase new (String id, UnicodeString name)
 Create test case.
bool run (TestSuite testSuite)
 Run test.
void setEnabled (bool enabled)
 Set if test case is enabled.
void setException (Exception exception)
 Set exception if test case failed.
void setState (State state)
 Set test state.
void setTestSuite (TestSuite testSuite)
 Set test suite.

Public Attributes

bool pEnabled
 Test case is enabled.
Exception pException
 Exception if test case failed.
String pID
 Test identifier.
UnicodeString pName
 Test name.
State pState
 Test state.
WeakReference pTestSuite
 Test suite.

Detailed Description

Test Case.

Version
1.5

Defines a test case. Test cases have a init(), run() and tearDown() method. While running the test case init() is called first. Then run() is called during each frame update until run() returns false. Once the test finished (either successfully or not) tearDown() is called. It is guaranteed tearDown() is always called if init() has been called.

Member Function Documentation

◆ assertColor()

void Dragengine.TestSystem.TestCase.assertColor ( Color found,
Color expected,
float range )

◆ assertDiffers()

void Dragengine.TestSystem.TestCase.assertDiffers ( Object found,
Object shouldNot )

Fail test if found equals expected.

References setState().

Referenced by assertColor().

◆ assertDVector() [1/2]

void Dragengine.TestSystem.TestCase.assertDVector ( DVector found,
DVector expected )

Fail test if vectors are not equal within range of 1mm.

Referenced by assertColor().

◆ assertDVector() [2/2]

void Dragengine.TestSystem.TestCase.assertDVector ( DVector found,
DVector expected,
float range )

Fail test if vectors are not equal within range.

References init().

◆ assertEquals()

void Dragengine.TestSystem.TestCase.assertEquals ( Object found,
Object expected )

◆ assertFalse()

void Dragengine.TestSystem.TestCase.assertFalse ( bool found)

Fail test if found is not false.

Referenced by assertColor(), and Dragengine.TestSystem.TestCaseECBehavior.run().

◆ assertNotNull()

void Dragengine.TestSystem.TestCase.assertNotNull ( Object found)

◆ assertNull()

void Dragengine.TestSystem.TestCase.assertNull ( Object found)

Fail test if found is not null.

References getException().

Referenced by assertColor().

◆ assertQuaternion() [1/2]

void Dragengine.TestSystem.TestCase.assertQuaternion ( Quaternion found,
Quaternion expected )

Fail test if quaternions are not equal within range of 1mm.

Referenced by assertColor().

◆ assertQuaternion() [2/2]

void Dragengine.TestSystem.TestCase.assertQuaternion ( Quaternion found,
Quaternion expected,
float range )

Fail test if quaternions are not equal within range.

References run().

◆ assertThrows()

void Dragengine.TestSystem.TestCase.assertThrows ( Block ablock)

Fail test if ablock does not throw an exception.

References pException, and setException().

Referenced by assertColor().

◆ assertTrue()

void Dragengine.TestSystem.TestCase.assertTrue ( bool found)

Fail test if found is not true.

Referenced by assertColor(), and Dragengine.TestSystem.TestCaseECBehavior.run().

◆ assertVector() [1/2]

void Dragengine.TestSystem.TestCase.assertVector ( DVector found,
DVector expected,
float range )

Fail test if vectors are not equal within range.

◆ assertVector() [2/2]

void Dragengine.TestSystem.TestCase.assertVector ( Vector found,
Vector expected )

Fail test if vectors are not equal within range of 1mm.

Referenced by assertColor().

◆ getEnabled()

bool Dragengine.TestSystem.TestCase.getEnabled ( )

Test case is enabled.

References getTestSuite(), and pTestSuite.

Referenced by init().

◆ getException()

Exception Dragengine.TestSystem.TestCase.getException ( )

Exception if test case failed.

References getID().

Referenced by assertNull().

◆ getID()

String Dragengine.TestSystem.TestCase.getID ( )

Identifier.

Referenced by getException().

◆ getName()

UnicodeString Dragengine.TestSystem.TestCase.getName ( )

Display name.

Referenced by setException().

◆ getState()

State Dragengine.TestSystem.TestCase.getState ( )

Test state.

Referenced by assertEquals().

◆ getTestSuite()

TestSuite Dragengine.TestSystem.TestCase.getTestSuite ( )

Test suite.

Referenced by getEnabled().

◆ init()

void Dragengine.TestSystem.TestCase.init ( )

◆ new()

TestCase Dragengine.TestSystem.TestCase.new ( String id,
UnicodeString name )

Create test case.

Reimplemented in Dragengine.TestSystem.TestCaseECBehavior, and Dragengine.TestSystem.TestCaseECBehaviorPersistency.

References new().

Referenced by new().

◆ run()

bool Dragengine.TestSystem.TestCase.run ( TestSuite testSuite)

Run test.

Called every frame update. Test keeps running while this method returns true. Once this method returns false the test finishes with state set to passed. To fail the test throw an exception.

Reimplemented in Dragengine.TestSystem.TestCaseECBehavior, and Dragengine.TestSystem.TestCaseECBehaviorPersistency.

References pEnabled, and setEnabled().

Referenced by assertQuaternion().

◆ setEnabled()

void Dragengine.TestSystem.TestCase.setEnabled ( bool enabled)

Set if test case is enabled.

Referenced by run().

◆ setException()

void Dragengine.TestSystem.TestCase.setException ( Exception exception)

Set exception if test case failed.

References getName(), and pID.

Referenced by assertThrows().

◆ setState()

void Dragengine.TestSystem.TestCase.setState ( State state)

Set test state.

References pTestSuite, and setTestSuite().

Referenced by assertDiffers().

◆ setTestSuite()

void Dragengine.TestSystem.TestCase.setTestSuite ( TestSuite testSuite)

Set test suite.

For use only by TestSuite.

Referenced by setState().

Member Data Documentation

◆ pEnabled

bool Dragengine.TestSystem.TestCase.pEnabled

Test case is enabled.

Referenced by init(), and run().

◆ pException

Exception Dragengine.TestSystem.TestCase.pException

Exception if test case failed.

Referenced by assertNotNull(), and assertThrows().

◆ pID

String Dragengine.TestSystem.TestCase.pID

Test identifier.

Referenced by setException().

◆ pName

UnicodeString Dragengine.TestSystem.TestCase.pName

Test name.

Referenced by init().

◆ pState

State Dragengine.TestSystem.TestCase.pState

Test state.

Referenced by assertEquals().

◆ pTestSuite

WeakReference Dragengine.TestSystem.TestCase.pTestSuite

Test suite.

Referenced by getEnabled(), and setState().


The documentation for this class was generated from the following file: