Yes, that's correct. I found myself however, that testing private and protected methods does make sense in certain cases.
Imagine a complex public method that abstracts part of its logic into private methods. Testing these, if there is an error, you will probably identify it easier if the error also shows in the tiny private method.
Furthermore, if you are building your class/app logic from bottom up using TDD (test driven dev), you will most probably encounter cases where you write tests for methods that you design as private.
Otherwise, I fully agree that if something is not used, it should be refactored.
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.
Yes, that's correct. I found myself however, that testing private and protected methods does make sense in certain cases.
Imagine a complex public method that abstracts part of its logic into private methods. Testing these, if there is an error, you will probably identify it easier if the error also shows in the tiny private method.
Furthermore, if you are building your class/app logic from bottom up using TDD (test driven dev), you will most probably encounter cases where you write tests for methods that you design as private.
Otherwise, I fully agree that if something is not used, it should be refactored.