Skip to content

Fake repositories #13

Answered by valentinajemuovic
yereby asked this question in Q&A
May 13, 2022 · 2 comments · 6 replies
Discussion options

You must be logged in to vote

@yereby, good question. My presentation showed only the usage of Fakes, but the wider list is: Dummies, Stubs, Spies, Mocks, Fakes. https://martinfowler.com/bliki/TestDouble.html

  • Stubs provide canned responses. So, for example, a StubRepository may always return John, Mary, Mike (these could be hard-coded in the StubRepository or it could be configurable, i.e. passing these in the constructor). There is NO logic within the StubRepository, so there's a method getCustomersOrderedByFirstName(), the Stub would NOT do any sorting, the Stub returns just a canned response.

  • Fakes have a working implementation, simulating the real adapter except they have to run in-memory. So for example, impl…

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
2 replies
@yereby
Comment options

@PCreations
Comment options

Comment options

You must be logged in to vote
4 replies
@yereby
Comment options

@valentinajemuovic
Comment options

@PCreations
Comment options

@yereby
Comment options

Answer selected by yereby
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants