Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

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

unit testing - Visual Studio: Run all tests in a single project?

In my Visual Studio solution, I have about a dozen projects, several of which contain unit test methods (tagged with the TestMethod attribute), with several hundred test methods spread across those projects.

From within Visual Studio, I'd like to run all of the (100+) tests in one particular project in the solution, without running the tests in the other projects in the solution.

Ctrl+R, A doesn't do what I want, since that runs all tests in the entire solution. I also don't see any options to run tests in a particular project in the Test menu, in the Test Explorer window, or in the right-click context menu for a project in the Solution Explorer window.

I'm using Visual Studio 2013.

What's the best way to get Visual Studio to run all of the test methods in a particular project?

question from:https://stackoverflow.com/questions/33550104/visual-studio-run-all-tests-in-a-single-project

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

1 Reply

0 votes
by (71.8m points)

After some additional poking around the UI, I figured out a decent way to do this:

  1. Open the Test Explorer window. (Test menu > Windows > Test Explorer)
  2. Click on the little down arrow just to the left of the search field.
  3. From the context menu that appears, select Project. The Test Explorer window contents change to be grouped by project in a 2-tier hierarchy.

Test Explorer filter menu

  1. Right-click on the desired project.
  2. From the context menu that appears, click Run Selected Tests.

Test Explorer project context menu

I'd still like a reasonable way to do this with only the keyboard, though!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...