Running tests on Visual Studio Unit vs Run ReSharper Unit Tests, differences?

So, while running Unit Tests, I ran into all the interesting issues in VisualStudio 2008.

For example, when running Visual Studio Unit tests, some tests fail together, but fail individually. This is because some class level variables in this test class are reused in unit tests.

Now, as a rule, I would go to each class and fix this problem manually! However, we are talking about tests that vary in the thousands!

Now an interesting dilemma arises, using both the ReSharper Unit Tests and TFS BuildServer tests, they run together!

Is there a way I could configure the VS Unit Test solution to run in the same way? I want to avoid calling the [TestInitialize] methods in the [TestCleanup] methods.

+4
source share
1 answer

This is usually a byproduct of differently ordered tests. ReSharper 4.x and earlier runs unit tests based on the order that they appear in the source file. Almost all other unit test runners run tests in alphabetical order. This different order may (but should never) affect whether or not tests pass (based on the data left in the database or statics).

ReSharper 5.0 no longer uses a custom runner, so it should fix these inconsistencies.

However, this type of inconsistency indicates a problem in the tests. Some of them reserve the data that they must clear, and some depend on the data remaining after the previous test, or suffered.

+4
source

Source: https://habr.com/ru/post/1303141/


All Articles