What are integration tests containing and how to set them up

后端 未结 3 1652
时光说笑
时光说笑 2021-01-15 11:28

I’m currently learning about unit tests and integration testing and as I understood it, unit tests are used to test the logic of a specific class and integration tests are u

3条回答
  •  日久生厌
    2021-01-15 12:01

    It would be valid to access a database as part of an integration test, as integration tests are supposed to show whether a feature is working correctly.

    If a feature were to not work because of a failed connection to a server side error, you would want the test to fail to inform you that this feature is not working. Integration tests are not there to inform you where the fault lies, just that a feature is not working.

    See https://stackoverflow.com/a/7876055/10461045 as this helps to clarify the widely accepted difference.

提交回复
热议问题