Unit Test Your Views
summary
Asserts that views can be unit tested on the JVM without instrumentation by building a tiny team‑ranking (tea) app and exercising UI logic with Robolectric and ActivityScenario and FragmentScenario while replacing dependencies via Koin injection. Tests mock the ViewModel, verify that the FAB click invokes addButtonClick, check that LiveData navigation events emit and that fragments and activities launch cleanly, and report that the approach works reliably and runs fast.
AI-written summary · about
chapters (12)
- 0:00Start
- 1:58What Brings People to Unit Testing
- 5:44Agenda
- 6:42Introduction
- 11:26Testing Pyramid
- 12:53Acceptance Tests
- 17:14Unit Testing
- 28:35Testing the Viewmodel Instead of the Model
- 30:53Outputs
- 31:49View Mode
- 32:38Trigger Navigation
- 46:37Navigation Controller
related talks
41mUnit Test Your Code, Even Your UI!
44mEfficient testing UI Android apps by example
46mEfficient Android UI Testing
42mProduction Level Test Driven Development and What's new
42mBuild testable apps for Android
20mUnit testing on Android
42mRock-Solid UI and Instrumentation Testing
38mThe Testing Pyramid – What does it mean for Android?
