Skip to content

Matchers

Ruby Lichtenshtein edited this page Apr 12, 2018 · 6 revisions

RxTest Matchers is like RxJava assertions with should instead of assert.

Example: should complete() instead of assertComplete()

RxTest Matchers

  • complete()
  • notComplete()
  • error(error: Throwable)
  • error(errorClass: Class<out Throwable>)
  • error(errorPredicate: (Throwable) -> Boolean)
  • noErrors()
  • value(t: T)
  • value(predicate: (T) -> Boolean)
  • values(vararg values: T)
  • valueSequence(sequence: Iterable<T>)
  • valueSet(set: Collection<T>)
  • valueOnly(vararg values: T)
  • valueCount(count: Int)
  • never(t: T)
  • never(predicate: (T) -> Boolean)
  • valueAt(index: Int, value: T)
  • valueAt(index: Int, valuePredicate: (T) -> Boolean)
  • empty()
  • timeout()
  • noTimeout()
  • subscribed()
  • notSubscribed()
  • failure(errorPredicate: (Throwable) -> Boolean, vararg values: T)
  • failure(error: Class<out Throwable>, vararg values: T)
  • failureAndMessage(error: Class<out Throwable>, message: String, vararg values: T)
  • result(vararg values: T)
  • terminate()