How does NUnit (and MSTest) handle tests that change static/shared variables?

后端 未结 1 1713
借酒劲吻你
借酒劲吻你 2020-12-19 03:04

I have some code that uses the shared gateway pattern to implement an inversion of control container. I have several hundred NUnit unit tests that exercises the code that u

相关标签:
1条回答
  • 2020-12-19 03:07

    Update:

    Visual Studio 2010 introduced the ability to run tests in parallel.

    Here is a step by step article about how to enable this.

    MsTest:
    So according to David Williamson, from Microsoft Visual Studio Team System, on this post in the MSDN forums:

    Tests absolutely do NOT run in parallel when run in VS or via mstest.exe. If they are run in a Load Test through VS then that is a different story. Basic execution, however, is always serial.

    Also, tests run using MsTest are each run using a different thread in order to ensure that you have a clean slate for each test. There is no way to disable this behavior.

    NUnit:
    NUnit runs all tests on the same thread.

    0 讨论(0)
提交回复
热议问题