Learn how to test SharedPreferences in your Android app using Dagger and Espresso. This course gives you a good understanding of using dependency injection with Dagger to write predictable and repeatable tests.
The sample app is written with Dagger 2 and Espresso 2.2, and the source code is included.
Update on 2016-01-14: I have discovered a better way to supply the test component using mock application and custom test runner, and updated clip 6: "Using Dagger in app and test" video.
Table of content
1. Persistence with SharedPreferences
2. The sample app
3. Dagger overview
4. Application component
5. Test component
6. Using Dagger in app and test
7. Espresso tests
9. Old video for Using Dagger in app and test
You'll need an account to access this in our app. Please create a password to continue.
Download from the App Store or text yourself a link to the app
Good news! Since you already have a Gumroad account, it's also been added to your library.Tweet Share