14 Ocak 2013 Pazartesi

VS2010 and VS2012 Unit Test Framework Capabilities



Hello all,
After long time, I have decided to continue share my experiences about software.  Now, I am working on a software project which is related with the Microsoft Technologies such as Silverlight, WCF, Entity Framework, SQL Server etc...
Last month we decided to migrate our development environment from VS2010 to VS2012. This was not very hard but after migration we have reliazed that new test explorer is not meet our needs anymore.
We have to provide our test results in .trx format and test coverage in .coveragexml format. We can easily provide these reports while we were using VS2010. But now VS2012 does not support exporting these files anymore. So we found some workaround solutions to provide these reports but still we have some problems.
I would like to explain what we were doing in VS2010 and what we are doing now on a sample project .

First, I have created 2 sample solution with same structure, one of them is in VS2010 and the other one is in VS2012. Solution structures as shown below.




































In VS2010  there was a view called "Test View" for viewing, grouping and running tests. Below images shows flexibility of the "Test View".































In VS2012 there is "Test Explorer" view. Test explorer view is really weak, you can only group tests by project.

   

















Let's run the tests and see what can we do with test results. First, run with VS2010, after running tests "Test Results" view automatically appears.
 This view provides us to export test results in .trx format, copy selected tests and re run selected test etc...











After that, run tests with VS2012. There is extra view is shown, test results is shown in same view. There is no feature to export .trx format and there is no feature to copy selected tests.

















 There is a way to export test results in .trx format from out of the solution. I will write another blog how to export test results in .trx format.