V
V
verykruta2021-11-02 15:32:31
Software testing
verykruta, 2021-11-02 15:32:31

Are these unit tests or integration tests?

Hello. I want to write tests for a validator that takes part of the data for validation from a third-party service, the object of which is received in the constructor.
If you lock the service, do the tests still remain integration tests or are they already Unit tests?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
taktik, 2021-11-02
@verykruta

Integration tests check the integration between different components of the system, for example, between 2 services or a service and a database.
In your example, you are mocking the second service, so the integration is not checked. So this is no longer an integration, but a unit test

D
Dmitry Roo, 2021-11-02
@xez

Integration.
A unit test only tests one method.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question