Why is dependency injection particularly valuable for testability?
- A A class receiving an interface can be given a fake implementation in tests
- B It makes classes smaller
- C It removes the need for tests
- D It speeds up compilation
Answer
A class receiving an interface can be given a fake implementation in tests
A ViewModel that constructs its own network client cannot be unit tested. One that receives a repository interface can.





