i find writing persistence tests for business objects to be tiresome. imagine setting up all the data that a current business object needs, including all the references needed by the test business objects to be saved.
initially, the tests assumes a default set of data from our test database and when the persistence of these reference tables/objects were introduced, we got these conflicting tests. although i can have the testfixtureteardown of the reference objects to repopulate their corresponding tables with the default data, i think it's better if my business object persistence tests to not rely on the said teardown routine.
a very common scenario in our project is when a failing test passes for some reason like when it was ran alone, or ran after the db script was executed. tests should be independent and in my opinion whatever data that a particular test fixture needs, he should be the one to set them up.
Posted
07-12-2006 3:55 PM
by
jokiz