I´m looking for a unit tests framework for database development. I´m currently developing for SQL Server 2000, 2005 and 2008. Do you know of any good frameworks with similar functionality as JUnit and NUnit?
Perhaps it´s better to ask, what do you use to unit test your stored procedures and user defined functions?
views:
293answers:
4Isn't that question quite similar to What is the best way to test a stored procedure? ?
I tend to use a data access assembly and test that with NUnit using the idea outlined in http://weblogs.asp.net/rosherove/articles/dbunittesting.aspx it uses transactions to rollback changes. This is not a dedicated database approach but is good if you want to test at a higher level than pure database.
It may be worth having a look at http://weblogs.asp.net/rosherove/archive/2004/07/12/180189.aspx
I'm currently using DBUnit in my project. It's quite a good tool to test a database to see if the results you expect are there, but also it can alter the data in a database to predefined values, for example, it will reset a database to the data you were using before the tests, leaving the tables unchanged.