Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
801 views
in Technique[技术] by (71.8m points)

visual studio - Tests not running in Test Explorer

I am currently working on a solution that has currently 32 Unittests. I have been working with the resharper test runner - which works fine. All tests are running, all tests are showing the right test outcome.

However, the tests are not running when using the Visual Studio test explorer.

The Test Explorer is showing all unit tests, but once clicking on "Run All", all tests are getting greyed out and show no result of the test run:

enter image description here

  • All test classes are public
  • All test classes are having the [TestClass] attribute declared
  • All test methods are using the [TestMethod] attribute
  • Both the productivity code and the test projects are targeting .NET 3.5.
  • I have already tried to clean build my solution, and / or delete all obj, bin, Debug and Release folders

I'd appreciate any hints which would explain this behaviour.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

If your projects aren't all AnyCpu then you may also want to check that the following 2 settings match:

  1. [Right click test project] -> properties -> Build -> Platform target - e.g. x64

  2. [Main Menu] -> Test -> Test Settings -> Default Processor Architecture -> X64

I found that when these didn't match my test project would silently fail to run.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...