Loading lesson…
Level 1 · Apprentice0 XP
Write fast, readable unit tests and use mocks only at the edges.
Step 1 / 6
ProblemA test fails with 'expected true but was false'. Nobody knows what value was wrong.
← → step
Before this: Packages, builds and dependencies
🛠️ Your turn
Reading is not the skill, doing is. Try for ten minutes before you open the hint. Getting stuck first is what makes the solution stick.
1.Write tests for a shipping-cost function: a parameterised test for normal cases, one for invalid input with assertThatThrownBy, and one using a Mockito mock for an external rate client.