Zum Hauptinhalt springen

Choose The Right Test Double

Select the simplest test double based on whether the test needs data, behavior verification, or a lightweight implementation.

unit-testing-basics5 min read

InvoiceService.markOverdue needs the current date. The desired behavior is that an invoice due yesterday becomes overdue. The clock is awkward because real time changes; the date comparison itself is not the behavior you want to lock down.

Read the full lesson

Sign up free: one personalized lesson every day, matched to your role and goals.

← Back to library

Kontakt aufnehmen