You don't want to test "private methods" but "public behavior". Private scope is about implementation details.

If happens that you feel the need to test a private method, it will luckily be that your class is responsible for multiple things.

TIP: Consider extracting that private method to another class, and create an interface to invert the dependencies between them. This way you will make your behavior testable.

Reply to this note

Please Login to reply.

Discussion

No replies yet.