Make Behaviors and Components more testible
In a behavior, I am able to abstract away things like mouse input so that I can simulate this in a unit test, but when it comes to testing some of the more ingrained functionality it starts to unravel.
As an example I would like to write a test that can show that when I simulate a click of a mouse I can see something being added to the EntityManager.
My attempts to do this so far have all failed.
EntityManager is baked so deep into the framework, you cannot mock it or fake it in any way. It doesn't have any interfaces and it is not virtual so I am unable to do anything sneaky like create my own Behavior super class and provide a new implementation for the EntityManager getter. I have tried creating proxy classes and went down a rabbit hole where null reference exceptions were being thrown in VirtualScreenManager.Refresh().