Open Barsonax opened 5 years ago
Worked around the 2th issue by wrapping up those static events in a class that implements a interface so I could mock out that part. Not ideal but atleast my unit tests are now completely deterministic again (static state + parallel unit tests == alot of WTF moments). Still it would be alot nicer if some of those events where just instance events so I don't have to come up with workarounds.
Summary
While writing unit tests for
Singularity.Duality
I came across some things that could be easier to unit test such as:Log
class. This class currently does not implement a interface so I had to write a adapter to do so. If duality would have aILog
interface this would have prevented me from having to make a adapter class.Scene.ComponentAdded
andScene.GameObjectsAdded
might cause unpleasant side effects in other unit tests. This is basically because its is a type of static state. This wouldnt be a problem if these events were not static.Thats pretty much it for now. Issue 2 might be harder to fix and also be possibly breaking as it probably requires a api change but issue 1 is really easy to do and can be added as of this moment I think.