Why do my tests fail when run together, but pass individually?

前端 未结 7 1218
有刺的猬
有刺的猬 2020-12-29 23:56

When I write a test in Visual Studio, I check that it works by saving, building and then running the test it in Nunit (right click on the test then run).

The test wo

7条回答
  •  忘掉有多难
    2020-12-30 00:25

    Such a situation normally occurs when the unit tests are using shared resources/data in some way.

    1. It can also happen if your system under test has static fields/properties which are being leveraged to compute the output on which you are asserting.
    2. It can happen if the system under test is being shared (static) dependencies.

提交回复
热议问题