This is a highly opinion-based topic, if you should or shouldn't test private/protected methods, just see the discussion here: stackoverflow.com/questions/105007...
I agree with the concepts you mentioned, but in some cases, especially when working with legacy code, creating unit tests for those methods could be beneficial. Also the tests can ensure that you don't make breaking changes in private methods.
The stackoverflow link you posted shows that the winner of the discussion (marked as accepted and higher votes) is the answer that tells you NOT to test private methods.
If a private method is changed, the tests for the public methods should pick it up, via a difference in the expected output of the public methods that use the private method.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
This is a highly opinion-based topic, if you should or shouldn't test private/protected methods, just see the discussion here: stackoverflow.com/questions/105007...
I agree with the concepts you mentioned, but in some cases, especially when working with legacy code, creating unit tests for those methods could be beneficial. Also the tests can ensure that you don't make breaking changes in private methods.
The stackoverflow link you posted shows that the winner of the discussion (marked as accepted and higher votes) is the answer that tells you NOT to test private methods.
If a private method is changed, the tests for the public methods should pick it up, via a difference in the expected output of the public methods that use the private method.