简体   繁体   中英

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?

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过滤器菜单

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

Test Explorer项目上下文菜单

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

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