Using Pex and Contracts to generate unit tests in Visual Studio 2010 and C# 4.0
This is the fourth post of a series about testing tools and techniques using Visual Studio 2010, Team Foundation Server 2010, Microsoft Test Manager 2010, and C# 4.0.
In a previous post I showed how to use Pex to automatically generate unit tests with high code coverage.
Contracts is a tool from Microsoft Research for Visual Studio implementing design by contract for the .NET Framework. Using Contracts, Pex generates better test cases. To get more details on how to use Pex and Contracts together, read this post.
In this video you will see how to add a precondition to a Factorial method of a Calculator class, and how Pex generates new test cases for this method.
You can also download the video.
More videos coming soon… keep tuned!