I do not test private methods. But what about internal state of the object?
I am working on a game. My object has public
update method. When this method is called, then it calls several private methods. For example
move method which should change position based on speed, heading and so.
Anyway coordinates are part of internal state.
On one hand, internal state probably should be not tested. On the other hand there are some calculations which I would like to have tested, but I do not not how (because it is done in private methods…).
Do you have any advice for me? Should I change my OO design somehow?
This is driving me crazy. I would like to write some code, but I am struggling with this…
Many thanks in advance for your replies.