Drag[en]gine Script Module DragonScript  1.23
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. More...
 
void assertDiffers (Object found, Object shouldNot)
 Fail test if found equals expected. More...
 
void assertDVector (DVector found, DVector expected)
 Fail test if vectors are not equal within range of 1mm. More...
 
void assertDVector (DVector found, DVector expected, float range)
 Fail test if vectors are not equal within range. More...
 
void assertEquals (Object found, Object expected)
 Fail test if found does not equal expected. More...
 
void assertFalse (bool found)
 Fail test if found is not false. More...
 
void assertNotNull (Object found)
 Fail test if found is not null. More...
 
void assertNull (Object found)
 Fail test if found is not null. More...
 
void assertQuaternion (Quaternion found, Quaternion expected)
 Fail test if quaternions are not equal within range of 1mm. More...
 
void assertQuaternion (Quaternion found, Quaternion expected, float range)
 Fail test if quaternions are not equal within range. More...
 
void assertThrows (Block ablock)
 Fail test if ablock does not throw an exception. More...
 
void assertTrue (bool found)
 Fail test if found is not true. More...
 
void assertVector (DVector found, DVector expected, float range)
 Fail test if vectors are not equal within range. More...
 
void assertVector (Vector found, Vector expected)
 Fail test if vectors are not equal within range of 1mm. More...
 
bool getEnabled ()
 Test case is enabled. More...
 
Exception getException ()
 Exception if test case failed. More...
 
String getID ()
 Identifier. More...
 
UnicodeString getName ()
 Display name. More...
 
State getState ()
 Test state. More...
 
TestSuite getTestSuite ()
 Test suite. More...
 
void init ()
 Initialize test. More...
 
TestCase new (String id, UnicodeString name)
 Create test case. More...
 
bool run (TestSuite testSuite)
 Run test. More...
 
void setEnabled (bool enabled)
 Set if test case is enabled. More...
 
void setException (Exception exception)
 Set exception if test case failed. More...
 
void setState (State state)
 Set test state. More...
 
void setTestSuite (TestSuite testSuite)
 Set test suite. More...
 

Public Attributes

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

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 
)

Fail test if colors are not equal within range.

◆ assertDiffers()

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

Fail test if found equals expected.

◆ assertDVector() [1/2]

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

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

◆ assertDVector() [2/2]

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

Fail test if vectors are not equal within range.

◆ assertEquals()

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

Fail test if found does not equal expected.

◆ assertFalse()

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

Fail test if found is not false.

◆ assertNotNull()

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

Fail test if found is not null.

◆ assertNull()

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

Fail test if found is not null.

◆ assertQuaternion() [1/2]

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

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

◆ assertQuaternion() [2/2]

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

Fail test if quaternions are not equal within range.

◆ assertThrows()

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

Fail test if ablock does not throw an exception.

◆ assertTrue()

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

Fail test if found is not true.

◆ 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.

◆ getEnabled()

bool Dragengine.TestSystem.TestCase.getEnabled ( )

Test case is enabled.

◆ getException()

Exception Dragengine.TestSystem.TestCase.getException ( )

Exception if test case failed.

◆ getID()

String Dragengine.TestSystem.TestCase.getID ( )

Identifier.

◆ getName()

UnicodeString Dragengine.TestSystem.TestCase.getName ( )

Display name.

◆ getState()

State Dragengine.TestSystem.TestCase.getState ( )

Test state.

◆ getTestSuite()

TestSuite Dragengine.TestSystem.TestCase.getTestSuite ( )

Test suite.

◆ init()

void Dragengine.TestSystem.TestCase.init ( )

◆ new()

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

◆ 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.TestCaseECBehaviorPersistency, and Dragengine.TestSystem.TestCaseECBehavior.

◆ setEnabled()

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

Set if test case is enabled.

◆ setException()

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

Set exception if test case failed.

◆ setState()

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

Set test state.

◆ setTestSuite()

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

Set test suite.

For use only by TestSuite.

Member Data Documentation

◆ pEnabled

bool Dragengine.TestSystem.TestCase.pEnabled

Test case is enabled.

◆ pException

Exception Dragengine.TestSystem.TestCase.pException

Exception if test case failed.

◆ pID

String Dragengine.TestSystem.TestCase.pID

Test identifier.

◆ pName

UnicodeString Dragengine.TestSystem.TestCase.pName

Test name.

◆ pState

State Dragengine.TestSystem.TestCase.pState

Test state.

◆ pTestSuite

WeakReference Dragengine.TestSystem.TestCase.pTestSuite

Test suite.


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