Showing posts with label private. Show all posts
Showing posts with label private. Show all posts

Friday, May 25, 2012

What"s the proper way to test a class with private methods using JUnit?


How do I use JUnit to test a class that has internal private methods? It seems bad to change the access modifier for a method just to be able to run a test.

Monday, February 27, 2012

Why is "Set()” function better than modifying public variable?


This one is bothering me for a while now :)

Hide my app contacts from user


I want to use the contacts API but for my specific application my users will most likely not want these contacts polluting their contact list. The application is targeted for delivery drivers and I want to use Contacts to keep track of past deliveries. I don't really care if the user can edit or change the contacts, but I don't want to confuse the user by having these contacts start populating in their address book.