This post originated from an RSS feed registered with Java Buzz
by News Manager.
Original Post: Howto: using files in unit tests
Feed Title: testdriven.com
Feed URL: http://feeds.feedburner.com/testdrivennewslinks?news=10&links=10
Feed Description: Your test-driven development community
When we write unit tests for our functions, we usually initialize some input data, call our function and then "assert" on the output data. But some functions take files as input or return their output in files. Where do you place these files so that tests will run on the integration server as well as all developer machines?
This was a problem we faced on our current project, and we solved it by putting the files inside the unit tests.