Reputation: 9194
Just trying to figure out what others are using to test their database procedures / queries, etc. Are you using the new Visual Studio extensions, custom code, etc? I need to some how formulate some unit tests, but not quite sure how I am going to build the tests so that we can easily regression test the procedures.
Upvotes: 6
Views: 1212
Reputation: 17080
That's a big question. We developed our own library in 2007, described here. Last fall I wrote about lessons learned during more than three years of using it.
Upvotes: 2
Reputation: 2100
You have lots of options--as you've already mentioned--but for true unit testing you always want to get as close to the actual unit under test as possible in order to avoid letting integration concerns intefere with your tests. For database objects, this means using the Visual Studio database unit test projects and writing SQL to unit test the database objects, or using some sort of 3rd party SQL-based testing framework like DBUnit.
In some cases you may want to use Linq-to-SQL to perform some database unit tests more concisely/easily than can be done in SQL, but this should be avoided unless absolutely necessary for true unit testing; Linq-to-SQL (and any other custom code) introduces integration issues and extra layers, and so if you encounter an error, you will first have to make sure it truly is an error in your database and not in your Linq-to-SQL database connection, C# code (for example), etc.
Upvotes: 4