Giter Site home page Giter Site logo

shoppingapptesting's Introduction

ShoppingAppTesting

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.

Prerequisites

- Android Studio (version 4.0 or later)
- Gradle (version 6.5 or later)

Getting Started

To get started with the project, follow these steps:
  1. Clone the repository to your local machine:
    
        git clone https://github.com/alishahbaz659/ShoppingAppTesting
    
  1. Open the project in Android Studio.
  2. Build and run the project to ensure that it is set up correctly.

Testing

The project includes the following types of tests:

Retrofit Network Setup Testing

The RetrofitNetworkTest class contains unit tests for testing the Retrofit network setup. These tests ensure that the API is properly set up and that data is retrieved correctly from the server.

ViewModel Testing using Fake and Default Repository

The ViewModelTest class contains unit tests for testing the ViewModel implementation. These tests ensure that the ViewModel properly handles data and that data is displayed correctly in the UI.

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.

Testing using Hilt

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.

Conclusion

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.

shoppingapptesting's People

Contributors

alishahbaz659 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.