Join Chiu-Ki Chan for an in-depth discussion in this video UI-less on-device test: Null test, part of Effective Android Testing for Mobile Developers.
- [Instructor] To test recipe store dot Java,…go to the file and then put your cursor…in the name of the class and press command shift T…to generate a new test.…Press okay, and choose Android test because we will need…to use the Android context in this test.…Press okay.…First, let's test the null case.…Press command N to generate a test method.…
Choose J Unit four and then we will call it null directory.…Remove the throws Exception line…and then first, we need a context…so that we can pass it to the recipe store.…Context context equal instrumentation registry…and then you do dot.…You can see that there are two functions,…both returning context.…One is get context, and the other one is get target context.…
Make sure you choose get target context…which returns the context for the app.…Get context, on the other hand,…returns the context for the test.…We will use the context from the app…because we are going to be testing…the recipes that is bundled within the app.…Create a recipe store with this context…and null as the directory.…
- 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.