Join Chiu-Ki Chan for an in-depth discussion in this video UI-less on-device test: Lookup test, part of Effective Android Testing for Mobile Developers.
- [Instructor] We also want to make sure…we can retrieve a recipe by its ID.…Copy and paste the count method…from line 20…to line 27.…Rename it get chocolate pudding.…Delete the assert lines.…If you look at the recipes folder,…we have a recipe called chocolate pudding,…and its ID is chocolate_pudding.…We are going to try to retrieve it in our test.…
To retrieve this chocolate pudding recipe.…We are going to call store.getRecipe.…Recipe, recipe,…equal store.getRecipe…and then with positive string…chocolate_pudding.…The getRecipe function is not yet written,…but we can generate from the test.…Press alt enter,…and choose create method getRecipe.…It will have to return type recipe…and then it will get a perimeter string,…but instead of calling it chocolate pudding,…we'll call it ID.…
The default implementation just returns null.…But we don't want that.…We want to be able to actually look up this recipe.…Right now, we don't have a look up table.…So lets add that.…Go to the top of the file…and create a private HashMap on line 16.…
- Why test?
- Local vs. on-device
- Code coverage
- UI testing
- Hermetic environment
- Dependency injection
- Testing with MVP
Skill Level Intermediate
Android App Development: Unit Testingwith James P White2h 58m Intermediate
Android App Development: Data Persistence Librarieswith Annyce Davis4h 52m 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.