Join Chiu-Ki Chan for an in-depth discussion in this video Dagger, part of Advanced Android Espresso Testing.
- [Instructor] Let's review how we used dependency injection…to create a hermetic environment for testing.…In our app,…we have our greeting application providing a clock…which gives us the current time.…During tests however, we have a test application…which provides a clock that has a fixed time.…In this example, we have a single dependency, clock.…So it is not too difficult…to do this dependency injection by hand.…
However most of our applications have multiple dependencies…and they may depend on each other.…For an example, a weather app may use a database…to store a list of cities…and shared preferences to remember…if the user prefers Celsius or Fahrenheit.…Both of them requires an android context to be created.…And then it may depend on the network library…to fetch the weather.…
When we have a dependency graph like this,…managing all the provide functions by hand…in the application, can get complicated.…Fortunately, there are dependency injection libraries…that can compute the dependency graph for you…and help you create them.…
- Incoming and outgoing intents
- How intents are used
- Dependency injection
- Why extract dependencies?
- Mockito and Dagger
Skill Level Advanced
Effective Android Testing for Mobile Developerswith Chiu-Ki Chan2h 56m Intermediate
Android App Development: Data Persistence Librarieswith Annyce Davis3h 59m Intermediate
2. Hermetic Test Environment
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.