Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • That entire section is about isolation techniques - think of that code example as of an intermediary step during the restructuring of your test. Fakes replace external dependencies. The book goes on to make a distinction between fakes being used as stubs and mocks. Stubs are never tested themselves (and they cannot cause the test to fail); their purpose, other then isolation, is to provide contextual setup so that you can test the other class under the specific conditions given in part by the stub (and in part by other setup code in the test itself). Commented Apr 7, 2020 at 9:31
  • *By "other class" I mean the class under test - the one that uses a fake as a dependency Commented Apr 7, 2020 at 9:31