|
bool | getCreateAndAddElementShouldFail () |
| Calling createAndAddElement() on element stub should fail by throwing an exception. More...
|
|
bool | getPreloadShouldFail () |
| Preloading on element class should fail. More...
|
|
void | init () |
| Initialize test. More...
|
|
TestCaseECBehavior | new (String id, UnicodeString name) |
| Create test. More...
|
|
bool | run (TestSuite testSuite) |
| Run test. More...
|
|
void | setCreateAndAddElementShouldFail (bool shouldFail) |
| Set calling createAndAddElement() on element stub should fail by throwing an exception. More...
|
|
void | setPreloadShouldFail (bool shouldFail) |
| Set preloading on element class should fail. More...
|
|
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 | 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...
|
|
|
void | addBehaviors () |
| Add behaviors to element class. More...
|
|
void | assertEnumProperty (ECPEnumeration property, Enumeration value, Set enumerationValues) |
| Assert element class enumeration property. More...
|
|
void | assertFloatProperty (ECPFloat property, float value) |
| Assert element class float property. More...
|
|
void | assertFloatProperty (ECPFloat property, float value, float limitLower) |
| Assert element class float property. More...
|
|
void | assertFloatProperty (ECPFloat property, float value, float limitLower, float limitUpper) |
| Assert element class float property. More...
|
|
void | assertIntegerProperty (ECPInteger property, int value) |
| Assert element class integer property. More...
|
|
void | assertIntegerProperty (ECPInteger property, int value, int limitLower) |
| Assert element class integer property. More...
|
|
void | assertIntegerProperty (ECPInteger property, int value, int limitLower, int limitUpper) |
| Assert element class integer property. More...
|
|
void | elementCreated () |
| Element created. More...
|
|
BehaviorElement | getElement () |
| Element to use for testing. More...
|
|
BehaviorElementClass | getElementClass () |
| Element class to use for testing. More...
|
|
GameWorld | getGameWorld () |
| Game world to use for testing. More...
|
|
PreloadCounter | getPreloadCounter () |
| Preload counter used to preload element class resources. More...
|
|
StubElement | getStubElement () |
| Stub element to use for testing. More...
|
|
bool | testBehaviors (TestSuite testSuite) |
| Test behaviors. More...
|
|
Base class for testing BehaviorElementClass behaviors.
- Version
- 1.5
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:
-
Create a GameWorld instance
-
Create a BehaviorElementClass instance
-
Wait for preloading resources to finish
-
Create a StubElement instance
-
Create BehaviorElement instance
-
Safely tear down all created resources
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.
class MyTestCase extends TestCaseECBehavior
end
protected var ECBehaviorComponent behavior
behavior = ECBehaviorComponent.
new(getElementClass(), null)
end
protected func void setStubProperties()
getStubElement().setPropertyValueFor("component.model", "/content/models/test.demodel")
end
end
var ECBehaviorComponent.Instance component = behavior.instance(getElement())
return false
end
end
TestCaseECBehavior new(String id, UnicodeString name)
Create test.
bool testBehaviors(TestSuite testSuite)
Test behaviors.
void addBehaviors()
Add behaviors to element class.
void elementCreated()
Element created.
StubElement getStubElement()
Stub element to use for testing.
BehaviorElement getElement()
Element to use for testing.
void assertNotNull(Object found)
Fail test if found is not null.