Stubs

Stubs are the next level up from dummies. A Stub test double will provide the same response regardless of the parameters passed into it.

Stubs are used when you want to test different paths of execution in your code. One instance is an error that must be thrown under a particular condition.

Stubs are created by creating a copy or override of the class or method that needs to return the stub value and then setting it to return the needed value. Remember, stubs don't evaluate parameters, so you need to just return the desired value.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.41.229