Question

I am currently working with Microsoft Visual Studio 2012 and the new Fakes framework. And after adding my unit tests to the MSBuild and continuous integration process, the Fakes unit tests happen to raise a ShimNotSupportedException.

I tried different stuff and read into that issue and found out that, this only happens when I run my tests from the Resharper feature, or directly in the code with MSTest. These exceptions DO NOT occur when running from the Test menu bar, which made me think about checking the setting files of this features.

After further research I found some articles where it says that it might has something to do with the code coverage setting specified in the Resharper or MSTest settings and if you switch that off, it solves the issue. ShimNotSupportedException in MS VisualStudio 2012 also relates to that problem.

I also found some input on the MSDN about that issue, which confirmed me that it has to do something with the code coverage: http://social.msdn.microsoft.com/Forums/en-US/vstest/thread/17fcfdc6-1cda-4692-a242-656b48195327/ and http://social.msdn.microsoft.com/Forums/en-US/vstest/thread/bfa792b0-b3fc-4a51-b49d-f7aaf1f2f4b8.

Nevertheless, since I have to implement code coverage into the continuous integration process somehow soon, and skipping that part is not an option, I am now asking here for any advice regarding this issue, and if there is any kind of solution to that problem!

Thanks for all advice!

Was it helpful?

Solution

Fakes is not supported by MsTest: http://msdn.microsoft.com/en-us/library/ms253138.aspx.

Here's how you can run the Visual Studio Testrunner from Team City (which supports Fakes): http://blog.degree.no/2012/09/unit-testing-visual-studio-2012-fakes-in-team-city/

You can also use the Visual Studio Testrunner if you use TFS.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top