How Does MSTEST/Visual Studio 2008 Team Test Decide Test Method Execution Order?

前端 未结 7 1460
一个人的身影
一个人的身影 2020-12-03 21:47

I was under the impression that the test methods in a unit test class would be executed in the order that they appear in the class file. Apparently this is not true. It also

7条回答
  •  清歌不尽
    2020-12-03 22:10

    In my experiences (I was little hard) I tried a lot of thinks about the change order of the method execution orders in the MStest project. I'm going to try describe the steps.

    1. You should ensure delete the default .testrunconfig and .vsmdi files. These files createdby Visual Studio when the creating test project.

    2. Close the Visual Studio instance and reopen it.

    3. When the Visual Studio opened you should open the Test List Edior then Create your own list under the Lists of tests section. After you create a new test list it should be empty.

    4. Go to All Loaded tests section then drag any test onto newly created test section with your choised order.

    Then ensure your last created test section checked and you can press the run test and voala it's running with your defined order.

    I don't know this might bug or some thing like that, but it magically working. We tested this method a couple of time with my colleague.

    Good lock

提交回复
热议问题