
In answer to other frameworks such as MbUnit being able to use this please see. I suppose mbUnit should be supported because Visual Studio is able to recognize it. Hi Ch.Tdd and thanks for question! I know that Visual Studio is able to recognize some other unit testing frameworks but I have made no attempts to use them this far. If your machine slows down then try to free more resources.ĭoes it work only with MSTest? Could i use VS to calc NUnit tests coverage? Tests with code coverage are slower because we need ASP.NET profiler.Make sure you selected all testable assemblies from Code Coverage settings like shown above.You can use EventViewer to discover errors that where given during testing. By example, I had to add some more Enterprise Library assemblies to my project. In some cases it needs more libraries to be referenced as you currently have. Make sure you have all assemblies available for code coverage.Here is my short list of possible problems. You may face some problems when making code coverage work. But it took me sometime to figure out how to get everything work as expected. I need a lot more tests for sure.Īs you can see everything was pretty simple. Visual Studio 2101 Code Coverage Results. Here you can see my example test results. When tests are run you can open code coverage results by selecting Test => Windows => Code Coverage Results from menu.NB! Select Test => Run => Tests in Current Context from menu. Run Visual Studio as Administrator and run tests.Save your project and close Visual Studio.Mark checkboxes that are located before assemblies about what you want code coverage reports and apply settings.Assemblies selection window will be opened. Move cursor to “Code Coverage” line and press Configure button or make double click on line.Mark checkboxes “ASP.NET Profiler” and “Code Coverage”.Select “Data and Diagnostics” from left pane.Double click on Local.testsettings under Solution Items.Now open the following screenshot to separate windows and follow the steps given below.Ĭlick on image to see it at original size. and, of course, you are using version of Visual Studio 2010 that supports tests (I have Visual Studio 2010 Ultimate).there are some classes and some tests for them,.there is at least on library that contains tests to be run,.there are at least one library that will be tested,.Before you start configuring Visual Studio I expect your solution meets the following needs: I am still not very sure why users must deal with this mess, but okay – I survived it. To save your valuable time I wrote this posting to guide you through the process of making code coverage work with ASP.NET MVC application unit tests.Īfter some fighting with Visual Studio I got everything to work as expected. Everything is simple after you have spent some time with forums, blogs and Google. I just got Visual Studio 2010 code coverage work with ASP.NET MVC application unit tests.
