You can open the project in Android studio and press run.
The project uses both instrumentation tests that run on the device and local unit tests that run on your computer.
The project creates an in memory database for each database test but still runs them on the device. To run both of them and generate a coverage report, you can run:
./gradlew fullCoverageReport (requires a connected device or an emulator)
Each ViewModel is tested using local unit tests with mock Repository implementations.
Each Repository is tested using local unit tests with mock database.
- Android Support Library
- Android Architecture Components
- Android Data Binding
- Hilt for dependency injection
- mockito for mocking in tests
TakeAway test project