Created
October 6, 2019 17:28
-
-
Save talosdev/09e7645503e10247ef0b927e19e68929 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
fun `observable to single with first() and default value`() { | |
val observable = Observable.fromIterable<Int>((1..5).toList()) | |
assertObservableToSingle(observable, { first(-1)}) { | |
assertComplete() | |
assertValue(1) | |
} | |
val emptyObservable = Observable.empty<Int>() | |
assertObservableToSingle(emptyObservable, { first(-1)}) { | |
assertComplete() | |
assertValue(-1) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment