Complete android Unit, Integration, Integrated and UI testing using TDD approach
This repository contains an Android project with sample code for implementing TDD (Test-Driven Development) in Android app development. The project includes testing for Room database, Retrofit network setup, ViewModel testing using both fake and default repository, and testing using Hilt dependency injection framework.
- Android Studio (version 4.0 or later)- Gradle (version 6.5 or later) To get started with the project, follow these steps:
- Clone the repository to your local machine:
git clone https://github.com/alishahbaz659/ShoppingAppTesting
- Open the project in Android Studio.
- Build and run the project to ensure that it is set up correctly.
The FakeRepository class is used for testing the ViewModel without actually connecting to the API. The DefaultRepository class is used for testing the ViewModel with a real API connection.
The project includes tests for Hilt dependency injection using the HiltTest class. These tests ensure that dependencies are properly injected and that the app functions correctly. This Android TDD testing project provides a sample implementation of TDD in Android app development, including testing for Room database, Retrofit network setup, ViewModel testing using both fake and default repository, and testing using Hilt dependency injection framework. You can use this project as a starting point for your own Android TDD testing projects.