Unit test sequence when performing all tests in the solution

In the VS2008 complex solution, I have three unit test projects. Since they work in the same test database, it is important that test projects run one after the other. It does not matter which project is first, only the one that is completed before the start of another.

If I want to execute all of them, there are several ways to do this, which will lead to different results:

  • I have a test list of a .vsmdi file where tests are ordered by project. If I open the list and run the tests from the test list editor, everything will be fine.
  • If I open the Test View window, sort the tests by project and run them, everything will be all right again.
  • However, if I run the tests by selecting "Test → Run → All Tests in Solution" in the menu, they are executed in random order, when some of them fail, because one of the other test projects has already manipulated the db test.

So the question is, what determines the unit test sequence when using the third approach? Is there a way to specify a default test list in .testrunconfig?

As there are workarounds, the problem is not critical. But any thoughts are welcome. Thanks.

+5
source share
1 answer

, xUnit Test Patterns. , Shared Fixture, , .

- . , .

, , , , MSTest . () , . (xUnit.NET ) , , . MSTest , -.

, Visual Studio Team Suite ( ,) Team Test, , Ordered Test. , , ( ) .

+8

All Articles