Terasology / Behaviors

Store for an assortment of behaviors that can be applied to creatures
https://terasology.github.io/Behaviors
6 stars 18 forks source link

feat: Added tests using MTE #42

Closed agent-q1 closed 3 years ago

agent-q1 commented 4 years ago

Tests in Behaviors

The tests in behaviors seem to have been made a long time ago. As pointed out by @skaldarnar , 8/8 fail when being built.

When I tried, only TestActions seemed to fail locally. On inspection, it came to light that without the line editor.initialize(getHostContext()); , behaviorNodeFactory would be null, causing the test to fail.

I'm still a bit confused as to whether using CoreRegistry.get() is a valid way of writing tests. The tests for TestTrees seem to pass locally though (7/8)

Thus, this PR adds a MTE test for the same already existing TestActions test.

DarkWeird commented 3 years ago

@agent-q1

Removed simple TestActions tests. Added ModuleTestingEnvironment as optional deps (required by MTE) Added some asserts without deep knowledge of Behaviours. Migrated TestActions to Junit5. Migrated TestActions to MTEExtension.

You can see profit from MTE tests now. just @In your services in your test.