aspose file tools*
The moose likes Testing and the fly likes test geter and setter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Bookmark "test geter and setter" Watch "test geter and setter" New topic
Author

test geter and setter

sam liya
Ranch Hand

Joined: Nov 25, 2008
Posts: 1222
can we test get method or set method in junit?
Joachim Rohde
Ranch Hand

Joined: Nov 27, 2006
Posts: 423

Yes of course. Like any other method it can be tested.
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
I think you are actually asking "the wrong question" - you shouldn't test methods, you should test behavior.

So, what behavior do you want to test?


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: test geter and setter