Exactly what is integration testing - compared with unit

前端 未结 5 1954
广开言路
广开言路 2021-02-01 14:18

I am starting to use unit testing in my projects, and am writing tests that are testing at the method/function level.

I understand this and it makes sense.

But,

5条回答
  •  佛祖请我去吃肉
    2021-02-01 15:08

    Consider a method like this PerformPayment(double amount, PaymentService service);

    An unit test would be a test where you create a mock for the service argument.

    An integration test would be a test where you use an actual external service so that you test if that service responds correctly to your input data.

提交回复
热议问题