简体   繁体   中英

Resharper Unit Test Runner: MSTest Deployment Items Issue

ReSharper Unit Test Runner: Support for Deployment Items

I have a follow up question for the question above. I'm using resharper version 4.5 with native mstest support to run mstest unit tests. When I configure resharper's unit test options to use my testrunconfig (in order to utilize my set of deployment items), my test runs end without displaying any results or errors. Has anyone using resharper's mstest runner had the same issue or anything similar?

I ran into this problem as well. I didn't want to disable code coverage however, because I often use it. The build server also uses it as well. So I wanted a solution that let me use R#'s runner most of the time for convenience, but still allow me to run my tests with Visual Studio's MSTest runner to get code coverage whenever I wanted as well as allow the build server to continue to generate code coverage statistics.

Workaround

I created an additional test settings file called Resharper.testsettings. It is exactly the same my normal Local.testsettings file except that it has code coverage disabled. Then I told R# to use this specific test run configuration.

  1. Open your Visual Studio Project
  2. Select Test->Edit Test Settings->Local (local.testsettings) (or whatever test settings you usually use)
  3. Click "Save As... "
  4. Name the file ReSharper.testsettings
  5. In the Name field of the General tab of the Test Settings window, change the name to ReSharper
  6. Click Data and Diagnostics
  7. Uncheck the box next to Code Coverage
  8. Go to ReSharper->Tools->Unit Testing
  9. Select the MSTest Unit testing provider
  10. Select "Use this Test Run Configuration:"
  11. Select ReSharper
  12. Click OK

If using R# 5.0 for step 8 there is an extra menu depth:

  1. Go to Resharper->Options->Tools->Unit Testing

Turns out that resharper's mstest runner does not work on testrunconfig files that have code coverage enabled. I've worked around the problem by disabling code coverage in my test run config file.

You do not need resharper to support standalone mstest installation. I explain how to make a standalone mstest installation without the VS in my post here - http://www.shunra.com/shunrablog/index.php/2009/04/running-mstest-without-visual-studio

Having similar problem. My MSTest tests run with Visual Studio test runner but not R#'s runner. The exception thrown is directly attributable to R# test run not finding the files that have to be deployed (and are specified in the testrunconfig).

Tried letting it pick the configured file and specified the file. No dice.

Don't know how to "disable code coverage" in the testrunconfig file other than to not specify any (and I don't).

Have asked R#. Now asking the StackOverflow audience.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM