RedditApp code challenge
Android Studio 3.1
./gradlew app:assembleDebug
To run unit tests only:
./gradlew test
To run instrumentation tests on connected devices:
./gradlew connectedAndroidTest
Generate Jacoco coverage reports. Both unit and espresso tests.
./gradlew jacocoTestReport
After executing the command line, the code coverge report can be found in this path:
/build/reports/jacoco/jacocoTestReport/html/index.html
The app consist of one UI Screen:
- FrontPage - Screen which manage a list of RedditPosts
This screen was implemented using the following classes:
- A Contract class (FrontPageContract)
- An Activity which ensembles the fragment and presenter.
- A Fragment which implements the view interface. It contains almost any business logic. It is using DataBinding in order to make the fragment even cleaner and light. Using the BindAdapters and layout data variables the fragment class it is easy to read and more maintainable.
- A presenter which implements the presenter interface in the corresponding contract. The presenter handles the UI and it also has a references to the repository class. The presenter contains important business logic for the screen, it handles the single observable from the respository in order to the filtering, sorting and validations required.
- RxJava2 and RxAndroid
- Retrofit / OkHttp
- Gson
- DataBinding
- Picasso
- Espresso for UI tests
- Robolectric for framework specific unit tests
- Mockito