Grokking Advanced Go
Vote

0% completed

​

Fakes and Mocks

A test double is any type that takes the place of a real dependency during a test. The term covers three kinds of type, and engineers often use their names as if they meant the same thing. A stub returns fixed answers. A fake is a small working implementation, such as a store backed by a map instead of a database. A mock records the calls it receives, so that a test can check which calls were made.

All three satisfy the same interface, so the code under test uses them all in the same way

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content