Mix tests and integration tests in the same assembly

My teammates understood (!?) The difference between integration testing and unit testing. Now, in our project, a test assembly is installed for each assembly.

Integration tests are currently written without a special structure such as SpecFlow or Cucumber. These are simple (and long) NUnit testing methods, where several classes from different assemblies are tested together.

Now we plan to classify tests by attributes (C #) using Unit Test and integration test so that NUnit can filter the corresponding tests if necessary.

Is it possible to mix integration tests and unit tests in the same assembly, or should they always be divided into different assemblies?

+4
source share
1 answer

Technically, this may work, but why do you want to do this?

While unit tests should test a “block”, which can be a function or any other small piece of code inside the assembly that your test assembly belongs to (one test assembly for each assembly), an integration test is testing some logic that usually implemented in more than one assembly, so having an additional assembly for integration tests and saving them from single tests is actually the best configuration in my eyes.

Read this from the article:

. , . , - , . , , , , , , , . . unit test, - , , API. - , . , . . , , . , , . , , -, , , , . , -. , , nUnit, xUnit Visual Studio Unit . , , , .

+3

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


All Articles