Friday, October 27, 2006

I have started using Team System at work and I stumbled upon the built in functionality to generate a unit test for a private method. At first I thought it was sweet that you could test private methods but then after going for a walk, I have come to the conclusion that this is not a good feature.

Someone has probably complained about this before but is there a situation where you would use a private method that is not eventually called by a public or protected method that is itself testable? Shouldn't you test the public or protected method to see if your private method is called and returns what you are expecting? I am going to avoid using this functionality until I find a valid reason to use it.

Friday, October 27, 2006 6:42:55 AM (GMT Standard Time, UTC+00:00)  #    Comments [2]  | 

Theme design by Jelle Druyts

Pick a theme: