Visual Studio 2012 comes with an extensible Unit Test Framework. Many of your favorite Unit Test frameworks (xUnit.Net, nUnit..) already have built adapters to Visual Studio. Peter Provost maintains a list of adapters here. If you have another unit test framework you like, you can build an adapter super easy. In this article, I will walk you through the steps required to build a Visual Studio 2012 Unit Test Adapter.
For the purposes of this discussion, I am going to write a Unit Test Adapter for XML files. The XML file will contain tests in the following format.
![Inline image 1](http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-45-92-metablogapi/6014.image_5F00_thumb_5F00_6FB3FD83.png)
After we install the new XML Test Adapter, we will see the following status in Test Explorer.
![Inline image 2](http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-45-92-metablogapi/4530.image_5F00_thumb_5F00_0DB20B78.png)
Step 1: Create a Discoverer
![Inline image 3](http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-45-92-metablogapi/4431.image_5F00_thumb_5F00_6EABE7D9.png)
QR: ![Inline image 4](http://chart.googleapis.com/chart?chs=80x80&cht=qr&choe=UTF-8&chl=http://blogs.msdn.com/b/visualstudioalm/archive/2012/07/31/writing-a-visual-studio-2012-unit-test-adapter.aspx)
0 comments:
Post a Comment