Every team you work in will have their own understanding of integration tests
, I tried to explain this better in my post on Testing Strategies
A general explanation of integration tests
could be as follows:
Code that invokes a unit of work that crosses project boundaries, uses actual external dependencies, and/or validates many different aspects about the code under test.
This can visually be understood as
That said, the integration can also be seen as the integration of units of work with-in your application. These units of work could be services or command/queries. Depending on what these units actually do they could be crossing project boundaries.
Examples
Unit b
may implement a http client that interacts with an external API - thats outside of your projects boundary. So the above image reflects this.Unit b
may implement some math calculations likereturn 42 + 0;
- thats inside your projects boundary but it still integrates withUnit a
Integration Test example
Probably controversial but I see Integration Tests
as being the same as a Component Tests
with the key difference that the Integration Tests
dont mock anything but the Component Tests
do.
So I would just use the Component Tests and instead of reading appsettings.Mock.json
, use appsettings.UAT|Prod.json
.
Alternate appoaches could be