In Visual Studio Team System Database Edition, three types of functionality are unit tested; Stored Procedures, Functions, and Triggers. It’s not so obvious how to test a trigger and at this time there are not many examples. This is probably because there are so many different testing needs. Testing the trigger is very similar to the more obvious calls to stored procedures and functions. This example shows how a trigger can be unit tested using the RAISERROR method to cause a test harness failure. Two other methods exist to perform unit testing failures for those complicated tests.
Last night’s North Dallas .Net User Group meeting was really good. Peter Debetta presented new features on SQL 2008. All of it was really interesting and will eventually be useful. I wouldn’t want to rehash all of the Microsoft documents and other blog information, but I will say that there are some useful features on the way.