This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I'm a beginner with JUnit and am somewhat stumped on how to go about testing these large methods. Looking for input as to how I should go about attacking these methods. Pasted first are the three methods I'm trying to crack and below that are the JUnit test methods that came up. So far I've only had fairly simple methods that I have had to test so these have thrown me off a bit. Any input is appreciated. Thanks much!
You can test the code by reading in the hard coded file, but that's hard. It would be better to pass in the filename so you could use a test file. Or pass in a Reader, so you can pass in a StringReader and not have to deal with files at all.
IN terms of going one step further, you read test method needs to instantiate d. It also needs an assert.