Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up

Why is dependency injection particularly valuable for testability?

  1. A A class receiving an interface can be given a fake implementation in tests
  2. B It makes classes smaller
  3. C It removes the need for tests
  4. 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.

All Android MCQs

Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up as