Join Chiu-Ki Chan for an in-depth discussion in this video MainActivityTest, part of Advanced Android Espresso Testing.
- [Narrator] Let's use the Test Component…in "Main Activity Test." Open Main Activity Test.…Right now, it is not compiling…because it wants to use provide clock function…from the app, which we deleted.…So, let's delete that line. That will be line 25.…Instead, what we want to do here…is to have the app component be the test component.…
App "dot" component "equal" dagger test component…and then dot builder.…Dagger test component is not yet generated…because we have not built the test yet.…To build the test, put your cursor on the gutter,…click on the green triangle,…and click "Run Main Activity Test."…We have a compilation error.…
That is alright because all we are doing here…is to generate the dagger test component.…And indeed, that changed from red to black.…So now we can continue writing our code, on line 25.…After builder, we want to supply a clock.…Dot clock and then we will give it a parameter called clock.…Afterwards, we will call dot build to create a component.…
Right now, we don't have a clock yet, so let's create that.…
- 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.