- [Instructor] Now we need to have…a different application during test.…First, create test recipe application…by right clicking on the package name…under Android test.…Scroll up, click on the package name,…right-click, new Java class.…We will call it, test recipe application.…Append dot injection in the package name.…Press okay.…We will have test recipe application…extend recipe application.…

This way, it can be used in place…of recipe application during test.…We will need to override the get favorites function…so that it returns shared preferences favorites…instead of in-memory favorites.…Press Control + Alt and override get favorites.…Instead of calling the super.getFavorites,…what we will do is we'll make a final field…called favorites, which is an in-memory favorites…and return it here.…

Outside of the get favorite function…we will add private, final, favorites,…and then we'll call it favorites.…We'll initialize it to new in-memory favorites.…And then, in line 11,…we will return this favorites.…To use a test recipe application during testing,…

Resume Transcript Auto-Scroll

Author

Released

8/30/2017

There's a difference between knowing how to implement testing and knowing when and why to do it. In this project-based course, get acquainted with best practices for testing Android apps by walking through a development workflow where testing is integrated throughout the process. As instructor Chiu-Ki Chan shows how to build the app, she explores the differences between JVM and on-device tests, explaining when to use each one. She also explores advanced techniques such as the MVP pattern. By demonstrating how testing fits into an app development workflow, she helps you bolster your ability to catch bugs—and determine where and when you should test.