Skip to content

Definition

A mock is a test double pre-programmed with expectations about the calls it should receive; unlike a stub, it fails the test when those expectations are not met, enabling behaviour verification.