Based on the Interception application block by Roy OSherove
See these links for details on the problems this helper is trying to solve:
http://weblogs.asp.net/rosherove/articles/dbunittesting.aspx
http://weblogs.asp.net/rosherove/archive/2004/07/20/187863.aspx
http://weblogs.asp.net/rosherove/archive/2004/10/05/238201.aspx
How do I use it?
Let’s say that you have a test fixture that performs various actions in each test against the database, including the basic CRUD operations (Insert, update, etc…).
In order to easily add roll back abilities to your tests do the following:
[Test, DataRollBack]
public void MyDataRelatedTest()
{
//this method will be performed inside a COM+ transaction
//this requires windows XP SP2 or better
//Windows Server 2003 works as well.
}