Join Chiu-Ki Chan for an in-depth discussion in this video TestApplication, part of Advanced Android Espresso Testing.
- [Instructor] Now that we have extracted…the time dependency into the application,…we will create a test application…so that we can override provideClock…to return a fixed time.…Go to your project tree and expand Android test.…Click on the package name,…right click, New,…Kotlin File/Class.…
We will call it TestApplication.…Inside, we will create the class TestApplication.…Class TestApplication: GreetingApplication.…This means that we want to subclass GreetingApplication.…However, Kotlin is not happy…because GreetingApplication, by default,…is a final class.…
Press Alt + Enter to make it open.…If you Command + click on GreetingApplication,…you can see on line five that…the keyword open has been added for us.…With that, we can subclass GreetingApplication.…On the gutter, you can see that there's…an O, arrow down.…That means there's a subclass,…and when you click on it,…it will jump to the TestApplication subclass.…
We have this subclass…because we want to override…the provideClock method,…so let's do that.…Override fun provideClock.…
- 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 Davis4h 52m 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.