Skip to content

Things that could be improved regarding unit testability. #699

Open
@Rick-van-Dam

Description

@Rick-van-Dam

Summary

While writing unit tests for Singularity.Duality I came across some things that could be easier to unit test such as:

  1. Mocking/facking the Log class. This class currently does not implement a interface so I had to write a adapter to do so. If duality would have a ILog interface this would have prevented me from having to make a adapter class.
  2. Forgetting to unsubscribe from Scene.ComponentAdded and Scene.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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    CoreArea: Duality runtime or launcherDiscussionNothing to be done until decided otherwise

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions