SchwartzLizer / NimbleSurvey

MIT License
0 stars 0 forks source link

[Question] Using real APIs for Unit Tests #8

Closed suho closed 11 months ago

suho commented 11 months ago

Issues

Currently, you are calling real APIs for unit tests. For instance, https://github.com/SchwartzLizer/NimbleSurvey/blob/ddfb80dcf8bc3a802aa6cc46158444bf75e38101/NimbleSurvey/NimbleSurveyTests/Login/LoginUnitTest.swift#L41

For unit tests, we should not use real APIs. We should mock the NetworkManager. What do you think?

SchwartzLizer commented 11 months ago

@suho you're right. I get confused when I need to write a unit test. I need to connect to a real API or mockup, so this is good advice. I am going to fix my unit test to change to mockup data.

I appreciate your advice.