Skip to content

Interactable Components

Pranay Premdas edited this page Sep 15, 2021 · 1 revision

Testing

  • Testing spawnBed: To test if the method is working, a dummy forestGameArea and terrainFactory instance is created using the Mockito framework. To verify that the bed is spawned the verify method in Mockito is used.

  • Testing createBed: To test if the createBed method is working, a combination of the spy, register and verify method from the Mockito framework is used. This will determine if a bed is able to be created.

  • Disadvantages of Testing spawnBed and createBed Test files: Both testfiles check for genral spawning and creating of entities. Therefore, the spawnBed and createBed is not explicitly tested. However, since the tests are passing it can be inferred that the spawnBed and createBed methods are working as expected.

  • Testing InteractableComponent: To test that the interactableComponent class, the collision triggering an animation change was tested using the event system, as well as testing for passing an invalid interactionString.

Clone this wiki locally