This blog is a knowledge base...where I clip cool tricks and urls

Unit Testing - extensions

I know a bunch of people have not been too enthusiastic about the unit testing features built into VSTS. Some people have become infatuated to many of the features of mbUnit. They are cool. But I like VSTS because of the built in code coverage capabilities and the integration with TFS.

1. Rollback. Yes...inspired by Roy, I created a Rollback attribute that wraps the annotated test in a System.Transaction that always gets rolled back. Usage

[TestMethod]
[Rollback]
public void PerformSomeDatabaseTests()
{
    //Make some databasebase calls...
}
 blog it

No comments: