简体   繁体   中英

nunit 3/resharper is not detecting all tests in a project

I am attempting to upgrade our solution from nUnit 2.6.4 to 3.8.0. The solution contains many projects some of which are test projects. My goal is to upgrade one project per commit to aid code reviews (we have around 12k of tests).

The problem I have is that one project contains around 500 tests, but when the resharper test runner runs on the project it only tests and runs 8 of these tests. I have installed the nUnit 3 test adapter for that solution.If I rebuild it will pick up on the missing tests in the test session but as soon as I run them, they disappear. I did notice that some of the test fixtures in this project used the [TestFor()] attribute without the [Test] attibute and some text fixture classes didn't have [TestFixture] attribute, however adding this did not help. The test fixtures do inherit from a base class in another project.

I have ensured that resharper has the support for nUnit 3.X tick box and have ensured that in Test -> Options the assemblies are set to target x64.

Is there anything else I can do?

I discovered the answer, most of my tests actually did have a dependency on one other project that handled a mock database we use for unit testing. This project needed to be updated to support 3.8.0. I still have a few missing unit tests in this project but I expect that is explained by Rob Prouse's comment where some tests have [TestFor] without a [Test] attribute.

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