Sample project to demonstrate how to unit test observables and subscriptions
Java
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
gradle/wrapper
.gitignore
LICENSE
README.md
build.gradle
gradlew
gradlew.bat
settings.gradle

README.md

TestingRxJava

RxJava is asynchronous by nature, so unit testing it might seem a daunting at first, especially if you use that asynchronous interaction to test stuff. Luckily, RxJava (and RxAndroid) come with a couple of tools that will make our life a lot easier.

This sample projects demonstrates how to:

  • test an observable (or a transformation of one or more observables) by using TestSubscriber
  • test how your app react to a subscription by mocking the real observable and overriding the default rxjava / rxandroid schedulers

More details can be found in this post from my blog