简体   繁体   中英

xUnit Tests skipped

In my VS2017 solution I have several unit test projects. In on of them my xUnit tests do not get discovered by mstest and therefore are not run.

I do get the warning:

Warning: [xUnit.net 00:00:00.7641189] Skipping: Testing.UnitTests (could not find dependent assembly 'Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0')

But Microsoft.VisualStudio.QualityTools.UnitTestFramework is referenced in the project in exactly that version. I have multiple unit testing projects. Many of them contain xUnit tests as well, but they get found and executed without any problems.

All projects containing xUnit tests have the same xUnit nuget packages assigned, especially xunit.runner.visualstudio

I am also using NCrunch and NCrunch has no problem discovering and execution the xUnit tests in question.

What could possibly be the reason to my problems?

Further Findings:

  • After upgrading Microsoft.VisualStudio.QualityTools.UnitTestingFramework to version 10.1.0.0, the xUnit tests were found but then I suddenly had 438 from 2447 failing. Those failing tests -mostly not xUnit - were previously working fine.
  • After shutting down an restarting visual studio the UnitTeestingFramework was automatically reset to version 10.0.0
  • opening the Reference Manager (Add References) all the project references are shown by selected checkboxes except of Microsoft.VisualStudio.QualityTools.UnitTestingFramework which only shows up if I previously add eg "Quality" to the search box, but then I see Microsoft.VisualStudio.QualityTools.UnitTestingFramework three times. One checked (version 10.0.0.0) an other one with same version, but different path and one with version 10.1.0.0

All together looks quite odd to me...

I had this issue but am not sure if this is exactly the same as yours. I saw an error in the output/tests window which stated it couldn't restore package xunit.runner.utility 2.2.0

After manually adding this in in package manager console like so:

install-package xunit.runner.utility -v 2.2.0

It started working again

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