Join Chiu-Ki Chan for an in-depth discussion in this video Why extract dependencies?, part of Advanced Android Espresso Testing.
- [Instructor] We extracted our external dependency…by creating a class called clock…and creating an application to provide that.…Why?…We put the clock in application…because the testing framework…has a mechanism to instantiate…a different application during test.…By placing the external dependency in the application…we can provide a different one during test.…
Instead of a clock that returns the actual time…we'll have it return a fixed time during test.…That way we know how our UI should behave…given that time rather than depending on…what time we run the test…and we're not able to verify what the app should do.…Next we will write that test application.…
- Incoming and outgoing intents
- How intents are used
- Dependency injection
- Why extract dependencies?
- Mockito and Dagger
Skill Level Advanced
Android App Development: Data Persistence Librarieswith Annyce Davis4h 52m Intermediate
Effective Android Testing for Mobile Developerswith Chiu-Ki Chan2h 56m 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.