Join Chiu-Ki Chan for an in-depth discussion in this video Incoming intents: Empty, part of Advanced Android Espresso Testing.
- [Narrator] To test incoming intents to ideas activity,…we need to create an Espresso test.…Put your cursor on ideas activity…and press Command+Shift+T to create a test.…We will call it ideas activity test.…We need to do three things to set up the test.…Annotate the test class, add an activity rule,…and then add the test method.…
First, add a body to your test class.…Then, on line five, add the annotation at run with and then…give it the parameter AndroidJUnit4, colon, colon, class.…This indicates that we are running an Android test.…Next, add your activity test rule.…On line nine, add at rule, at JvmField,…and then var activity rule equal activity test rule…and then give it the parameter…ideas activity, colon, colon, class dot java.…
Let's go through the annotations.…At rule means that this is a J unit test rule.…This tells J unit that we want to run this rule…every single time before we run a test method.…What does this rule do?…This rule launches an activity.…The second annotation, at JvmField, is a cotland fix.…
- 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.