-
Notifications
You must be signed in to change notification settings - Fork 0
Test double β Mock
Devrath edited this page Oct 24, 2023
·
1 revision
- Mocks are used to replace the interface
- It is used to check if the function is called or not.
- It is used to check if the right parameters are passed or not.
- It is also used to check how many times the function is called.
- To check the return type of the function it is calling.
- We call a server using retrofit
- We actually call an abstract function of an interface and the abstract function communicates to a real server and returns data.
- Using mocks we can make the abstract function communicate to the mock server and return data.