Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 479863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T00:50:05+00:00 2026-05-13T00:50:05+00:00

In a complex VS2008 solution I have three unit test projects. As they operate

  • 0

In a complex VS2008 solution I have three unit test projects. As they operate on the same test database it is important that the test projects are executed one after the other. It is not important which project first, just that one is finished before the other starts.

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

  • I have a test list .vsmdi file where the tests are ordered by project. If I open the list and execute the tests from the test list editor, everything is fine.
  • If I open the Test View window, sort the tests by project and run them, again everything is fine.
  • However if I run the tests by selecting ‘Test -> Run -> All Tests in Solution’ from the menu, they get executed in random order where some of them fail, as one of the other test projects already manipulated the test db.

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 the .testrunconfig?

As there are workarounds, the issue is not critical at all. But any thoughts are welcome.
Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T00:50:05+00:00Added an answer on May 13, 2026 at 12:50 am

    You are experiencing a unit testing smell called Interactive Tests, described in the excellent xUnit Test Patterns. More specifically, you suffer from a Shared Fixture, which is another way of saying that several of your tests use the same shared database, and that they are dependent on the outcome of previous test runs.

    This is an anti-pattern and should be avoided at all cost. The book offers extensive guidance on how to deal with this situation.

    The reason I start out by describing this is that this is the reason that MSTest doesn’t guarantee ordering of the tests. Although the order may seem (semi)deterministic, you can’t rely on it. Some other unit testing frameworks (xUnit.NET comes to mind) even go so far as to run tests in a random order each time you run the test suite. MSTest isn’t that extreme, but there are no way you can order your unit tests.

    That said, if you are running Visual Studio Team Suite or (I believe) Team Test, there’s a type of test called an Ordered Test. You can use that to specify that all tests (including unit tests) should execute in a specific order.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 354k
  • Answers 354k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You need to do this through VBScript and load in… May 14, 2026 at 7:52 am
  • Editorial Team
    Editorial Team added an answer EDIT: I tried to clarify I bit more ... 1.… May 14, 2026 at 7:52 am
  • Editorial Team
    Editorial Team added an answer Read each line, stick the contents of the line into… May 14, 2026 at 7:52 am

Related Questions

I'd like to build a CMS site based on Asp.Net Mvc and I want
i am building a solution with approximately 100 assemblies that is taking a considerable
I'm currently working on a quite big (and old, sigh) code base, recently upgraded
OK, so we all know the daily build is the heart beat of a

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.