Join Chiu-Ki Chan for an in-depth discussion in this video Test state: Test, part of Effective Android Testing for Mobile Developers.
- [Voiceover] Let's add a new test method…for the case where recipe is already a favorite.…Go back to recipe activity test, you can do that…by pressing command o, and search…for recipe activity test.…Scroll down.…You will need to launch the activity, just like…in click to favorite.…So let's extract that into a helper method.…Highlight line fifty three through fifty five.…Right click, refactor, extract, method.…
We will call it launch recipe.…Press okay.…In launch recipe, we will add a parameter called ID.…String ID, and then we will use the ID instead…of creamed carrots in the put extra…in line sixty four.…Now, in line fifty three, it is unhappy,…because now launch recipe takes a parameter.…We are going to go ahead and add it,…but this time we'll define it as a constant.…
The reason why we want it to be a constant is…because we will reuse that in another test method.…We will call this constant carrots underscore ID.…Press alt enter to create a constant field.…Make sure that it actually matches the ID.…So to be completely sure, what you can do is…
- Why test?
- Local vs. on-device
- Code coverage
- UI testing
- Hermetic environment
- Dependency injection
- Testing with MVP
Skill Level Intermediate
1. Testing Considerations
2. Test as You Go
3. UI Testing
4. Hermetic Environment
5. Robot Pattern
- 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.