Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Different Test Settings per project in same solution Visual Studio

Tools:

1.Visual Studio 2010

2.Visual Studio Unit tests.

Story:

We develop a solution that has several projects, for each project there is a test project. Each test project has its deployment items that it needs. That's why every test project has its own test settings.

Question:

I would like to be able to run all the test projects at once to get statistics for all the solution (code coverage, etc..).

Is there any way to do this without merging all test settings into one (this solution maybe problematic)?

EDITED

Any other solution to test all the solution will be highly appreciated.

like image 821
Sergey Kucher Avatar asked Apr 04 '12 12:04

Sergey Kucher


People also ask

How do I run a specific test in Visual Studio?

If Test Explorer is not visible, choose Test on the Visual Studio menu, choose Windows, and then choose Test Explorer (or press Ctrl + E, T). As you run, write, and rerun your tests, the Test Explorer displays the results in a default grouping of Project, Namespace, and Class.

Does TestInitialize run for each test?

TestInitialize and TestCleanup are ran before and after each test, this is to ensure that no tests are coupled. If you want to run methods before and after ALL tests, decorate relevant methods with the ClassInitialize and ClassCleanup attributes.


1 Answers

Unfortunately project specific test settings are not supported. One solution I often employ is to change the output folder for all projects to a common location. This is also a build performance optimization as dependencies aren't copied multiple times.

This strategy simplifies the deployment strategy as all my test projects write to common folders (ie TestData) and I can add a single deployment item to copy the entire directory for the test run.

like image 160
bryanbcook Avatar answered Oct 20 '22 07:10

bryanbcook