Рет қаралды 1,369
When to mock and when to not mock? While I don't have a single answer to rule em all, I confidently believe this: When you don't know the outcome -- you simply have to mock. Because if you can't test output, you have to test interactions, But if your method is query (i.e. it returns something) and not only a command (i.e. it mutates state) then we should sensibly want to test the return value and not merely the interactions. But since we don't know what it will return we have to mock and assert over mocks.
Classicist vs Mockist Testing
• Classicist vs Mockist ...
Unit vs Integration Testing
• Unit vs Integration te...
GEAR USED
► CAMERA: Canon 70D amzn.to/29wR8wG
► LENS: Canon 10-18mm amzn.to/29srabL
► TRIPOD: JOBY Gorillapod Zoom amzn.to/29AdkHT