Fake it till you make it - effective use of test doubles
summary
Explains when to use stubs, fakes, mocks and dummies with concrete examples: a splash screen presenter tested by injecting a fake view that records loading/error state, a stubbed use‑case that returns logged‑in or throws, and a mocked router verified to open main or login screens. Uses Mockito(+Kotlin extensions) for classic mocks but warns Mockito cannot mock suspend functions; recommends MockK supports suspend functions and final classes. Shows alternatives for static APIs: wrap, set global delegates, or use MockK/PowerMock. Emphasizes constructor injection and readability.
AI-written summary · about
