Say we have two functions:
Update Table
Import Data
where the second function calls the first function based on some rules/logic.
Would an integration test be written for each function? Or does it make sense to only have one integration test?
08-07-2022 09:06 PM
Oh , so sorry but i m not sure about that.
Using a database (or an external connection to a service you are using) in an integration test is not only valid, but should be done. However, do not rely on integration tests heavily. Unit test every logic element you have and set up integration tests for certain flows.
Integration tests can be written in the same way, except (as you mentioned) they include more methods etc. In fact, the code snippet you've shown above is a common start write-up of an integration test.
You can read up more on tests here: https://softwareengineering.stackexchange.com/questions/301479/are-database-integration-tests-bad /ehatomeglz
08-24-2022 03:57 AM