Error performing unit tests in visual studio: no test objects

I get the following error when running unit tests from visual studio using resharper:

Test-case objects missing for the following elements: ... Rebuild the project and try again

The tooltip next to the unit test method says:, Inconclusive: Test not runand I think he said Unit test skippedat some point. Resharper shows a gray eye icon.

There is also a strange problem with the visual studio Test Explorer. It will not show all my unit tests. In fact, he misses more than 200 of my unit tests. They simply do not appear in the Test Explorer window. I have several tests that appear and will work fine.

Things I've already tried: rebooting my machine, cleaning up, rebuilding, changing all dependent projects to use the same .net structure 4.7.

I am using VS 2017.net Framework 4.7, Resharper and MSTest. All with the latest updates and versions.

+40
source share
9 answers

I ran into this error after uninstalling all nuget packages, since I changed my version of .net and did not need any of them to compile.

After reinstalling the nuget MSTest.TestAdapter package, ReSharper started to run my unit tests again, as expected.

Install-Package MSTest.TestAdapter

+33
source

I know this will not answer the OP question since he or she tried it, but maybe it will help someone else.

For me, a simple restart Visual Studio solved the Test-case objects that were missing for the following elements: ... Rebuild the project and try the problem again .

+17

, , Test Explorer. .

unit test "" x64. AnyCPU, Test Explorer . , resharper . , . , , .

+4

, Nuget FLEE, app.config :

<dependentAssembly>
  <assemblyIdentity name="System.Reflection" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
  <bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
</dependentAssembly>

4.1.2.0 ( 4.0.0.0), - " "

, (1.05) FLEE ( 4.0.0.0) 4.0.0.0 bindingRedirect app.config,

+2

.

, , , .

+1

F #. ;

[<TestMethod>]
member x.''E is updated where generic form or visit should include (this) UPDATED VISIT AND FORM''() =
        let origExpr = "visit:form:INTQ1AB"
        let checkedExpr = "VISIT2:FormFour:INTQ1AB"
        ...

, "()",

[<TestMethod>]
member x.''E is updated where generic form or visit should include this UPDATED VISIT AND FORM''() =
        let origExpr = "visit:form:INTQ1AB"
        let checkedExpr = "VISIT2:FormFour:INTQ1AB"
        ...

.

+1

MSTest.TestAdapter 1.1.18 1.3.2. .

+1

, Resharper Nunit NuGet. , , .NET, .NET. NUnit NuGet, .

0

After cloning the solution to a new machine, I ran into this error. The problem was that I did not have the indicated dotnet platform installed - I installed only 2.1 and 3.0, and this took 2.2. In fairness, an error in the test results did report this:

Testhost process exited with error: It was not possible to find any compatible framework version
The specified framework 'Microsoft.NETCore.App', version '2.2.0' was not found.
  - The following frameworks were found:
      2.1.13 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      3.0.0 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
You can resolve the problem by installing the specified framework and/or SDK.
The .NET Core frameworks can be found at:
  - https://aka.ms/dotnet-download
. Please check the diagnostic logs for more information.

Please note that Visual Studio required a restart after installing the missing framework.

0
source

Source: https://habr.com/ru/post/1693748/


All Articles