How Does Swift Support Stubbing and Mocking? • Quality Coding

Mocks often make unit tests easier to write. But how do we mock, when Swift is strict about types? The trick is to use Swift's protocols and extensions.