I have a simple CRUD operation that needs to be checked by the module. These test cases relate to the DAO layer, so all tests relate to the database and therefore cannot be mocked.
So, I have one test case for creating another for updating, and another for reading.
Should I hard-code the data in the JUnit class or externalize it?
Reading TestCase obviously requires data in the database. Do I have to depend on Create Test scripts to set up the data or use an SQL statement to do this?
What is the best practice?
If you can point me to an online resource that discusses this, that would be great.
source
share