|
Drag[en]gine Script Module DragonScript 1.35
|
Base class for testing BehaviorElementClass behaviors. More...
Classes | |
| class | TestBehaviorElementClass |
| Helper class to store the created element aside. More... | |
Public Member Functions | |
| bool | getCreateAndAddElementShouldFail () |
| Calling createAndAddElement() on element stub should fail by throwing an exception. | |
| bool | getPreloadShouldFail () |
| Preloading on element class should fail. | |
| void | init () |
| Initialize test. | |
| TestCaseECBehavior | new (String id, UnicodeString name) |
| Create test. | |
| bool | run (TestSuite testSuite) |
| Run test. | |
| void | setCreateAndAddElementShouldFail (bool shouldFail) |
| Set calling createAndAddElement() on element stub should fail by throwing an exception. | |
| void | setPreloadShouldFail (bool shouldFail) |
| Set preloading on element class should fail. | |
| Public Member Functions inherited from Dragengine.TestSystem.TestCase | |
| 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 | 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. | |
Protected Member Functions | |
| void | addBehaviors () |
| Add behaviors to element class. | |
| void | assertEnumProperty (ECPEnumeration property, Enumeration value, Set enumerationValues) |
| Assert element class enumeration property. | |
| void | assertFloatProperty (ECPFloat property, float value) |
| Assert element class float property. | |
| void | assertFloatProperty (ECPFloat property, float value, float limitLower) |
| Assert element class float property. | |
| void | assertFloatProperty (ECPFloat property, float value, float limitLower, float limitUpper) |
| Assert element class float property. | |
| void | assertIntegerProperty (ECPInteger property, int value) |
| Assert element class integer property. | |
| void | assertIntegerProperty (ECPInteger property, int value, int limitLower) |
| Assert element class integer property. | |
| void | assertIntegerProperty (ECPInteger property, int value, int limitLower, int limitUpper) |
| Assert element class integer property. | |
| void | elementCreated () |
| Element created. | |
| BehaviorElement | getElement () |
| Element to use for testing. | |
| BehaviorElementClass | getElementClass () |
| Element class to use for testing. | |
| GameWorld | getGameWorld () |
| Game world to use for testing. | |
| PreloadCounter | getPreloadCounter () |
| Preload counter used to preload element class resources. | |
| StubElement | getStubElement () |
| Stub element to use for testing. | |
| bool | testBehaviors (TestSuite testSuite) |
| Test behaviors. | |
Additional Inherited Members | |
| Public Attributes inherited from Dragengine.TestSystem.TestCase | |
| 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. | |
Base class for testing BehaviorElementClass behaviors.
This class helps to test ECBehavior subclasses by providing the boiler plate code required to set up such tests. In particular this base class does the following:
This class calls hook methods at specific points during the test to allow the subclass to set up the behaviors in the required layout as well as running the tests. The following example implementation shows how a subclass can be written.
|
protected |
Add behaviors to element class.
Reimplemented in Dragengine.TestSystem.TestCaseECBehaviorPersistency.
Referenced by assertFloatProperty(), and run().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Assert element class integer property.
References elementCreated().
Referenced by run().
|
protected |
|
protected |
Assert element class integer property.
References Dragengine.TestSystem.TestCase.assertNotNull().
|
protected |
Element created.
Reimplemented in Dragengine.TestSystem.TestCaseECBehaviorPersistency.
References setCreateAndAddElementShouldFail().
Referenced by assertIntegerProperty(), and run().
| bool Dragengine.TestSystem.TestCaseECBehavior.getCreateAndAddElementShouldFail | ( | ) |
Calling createAndAddElement() on element stub should fail by throwing an exception.
References getElement().
Referenced by setPreloadShouldFail().
|
protected |
Element to use for testing.
Reimplemented in Dragengine.TestSystem.TestCaseECBehaviorPersistency.
Referenced by getCreateAndAddElementShouldFail().
|
protected |
Element class to use for testing.
Reimplemented in Dragengine.TestSystem.TestCaseECBehaviorPersistency.
Referenced by getPreloadCounter().
|
protected |
Game world to use for testing.
Reimplemented in Dragengine.TestSystem.TestCaseECBehaviorPersistency.
References getStubElement().
Referenced by getPreloadShouldFail().
|
protected |
Preload counter used to preload element class resources.
Reimplemented in Dragengine.TestSystem.TestCaseECBehaviorPersistency.
References getElementClass().
Referenced by setCreateAndAddElementShouldFail().
| bool Dragengine.TestSystem.TestCaseECBehavior.getPreloadShouldFail | ( | ) |
Preloading on element class should fail.
References getGameWorld().
Referenced by assertFloatProperty().
|
protected |
Stub element to use for testing.
Reimplemented in Dragengine.TestSystem.TestCaseECBehaviorPersistency.
References new().
Referenced by getGameWorld().
| void Dragengine.TestSystem.TestCaseECBehavior.init | ( | ) |
Initialize test.
Reimplemented from Dragengine.TestSystem.TestCase.
Reimplemented in Dragengine.TestSystem.TestCaseECBehaviorPersistency.
References Dragengine.TestSystem.TestCase.assertEquals(), and assertFloatProperty().
Referenced by run().
| TestCaseECBehavior Dragengine.TestSystem.TestCaseECBehavior.new | ( | String | id, |
| UnicodeString | name ) |
Create test.
Reimplemented from Dragengine.TestSystem.TestCase.
Reimplemented in Dragengine.TestSystem.TestCaseECBehaviorPersistency.
Referenced by getStubElement(), and run().
| bool Dragengine.TestSystem.TestCaseECBehavior.run | ( | TestSuite | testSuite | ) |
Run test.
Reimplemented from Dragengine.TestSystem.TestCase.
Reimplemented in Dragengine.TestSystem.TestCaseECBehaviorPersistency.
References addBehaviors(), assertEnumProperty(), Dragengine.TestSystem.TestCase.assertEquals(), Dragengine.TestSystem.TestCase.assertFalse(), assertFloatProperty(), assertIntegerProperty(), Dragengine.TestSystem.TestCase.assertTrue(), elementCreated(), init(), new(), run(), and testBehaviors().
Referenced by run().
| void Dragengine.TestSystem.TestCaseECBehavior.setCreateAndAddElementShouldFail | ( | bool | shouldFail | ) |
Set calling createAndAddElement() on element stub should fail by throwing an exception.
References getPreloadCounter().
Referenced by elementCreated().
| void Dragengine.TestSystem.TestCaseECBehavior.setPreloadShouldFail | ( | bool | shouldFail | ) |
Set preloading on element class should fail.
References getCreateAndAddElementShouldFail().
Referenced by assertFloatProperty().
|
protected |
Test behaviors.
Reimplemented in Dragengine.TestSystem.TestCaseECBehaviorPersistency.
Referenced by assertIntegerProperty(), and run().