Unit Test and Integration Test

I have played a bit with ECS and really like it. Now I want to make something more serious and make my code more reliable by using unit and integration test of my systems. And I have some questions:
0) How to create System in test? Should I use “new MySystem()”, or some ecs api?

  1. How to [Inject] component groups to system in test?
  2. How to test interaction of systems? I don’t want to create all systems for each test (when game become big enough it will be too slow). I want to create only systems required for this test.
  3. In multiple system setup - how to invoke update of all added systems taking in accound UpdateBefore and UpdateAfter attributes?
1 Like

If you look in the packages folder for the ECS packages, you will not only find all the sourcecode for ECS, but also all our own unit tests, that you can use for inspiration on how to write tests for ECS related code.

2 Likes