I know there is an ongoing debate in many posts [ 1,2 ] in this sites on whether you should test private methods directly or indirectly.
What I can't seem to understand is how can I test a class where it has for example -
3 private methods that are approached by 10 different public methods.
Let's say the private methods sort its specific data structures or retrieve a value from them in a special way that only relates to the class (I am not going to create an inner class in every scenario).
Now, if I choose to test the private indirectly than I would have to re-write the tests for that private logic every time I test the public methods in order to fully test the method and keep the unit tests independent.
(It is not always possible to create a private method in the test class that tests the mutual code )
I will than have a to write repeating code and long test methods.
So how is the indirect testing eligible as a standard?