I have a simple CRUD operations that needs to be unit tested These test cases are for DAO layer- so all tests are against the database and hence cant be mocked.
So I have one test cases for create another for update and another for read.
1) Should I hard code the data in the JUnit class or do you externalize it ?
2) The Read TestCase would obviously need data in the database. Should I depend upon the Create Test cases to set up the data or use a SQL statement for that ?
what is the best-practice on this?
If you can point me to an internet resource which discusses this- that would be great.
Thanks !!!