Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The method should still do the same thing, regardless if it is private or public. If you purposefully create a new method and get rid of the old one, regardless if this is done by creating and deleting or by modifying, then the unit test should be changed as well.

In short, you are testing the interface of that private method, not the implementation.



By that logic you could test a single line and say "I'm testing the interface of that line, not the implementation".


You could if your line had a syntactical construct that presented an interface, like say, a name and a parameter list.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: