-
Notifications
You must be signed in to change notification settings - Fork 0
What is stub
Devrath edited this page Jun 26, 2021
·
2 revisions
- There are scenarios where I want to check what my function returns and based on that I want to check how my code works. This is the ideal scenario for the usage of stubs.
- Generating predefined output.
- We check if the piece of code returns
success
,failure
,exception
based on the block of the code. - If there is a piece of code inside the function that causes the exception and we need to check this we can use stubs.
We use stubs to check the behaviour of the code under test