Skip to content

Instantly share code, notes, and snippets.

View aanandshekharroy's full-sized avatar
👋

Aanand Shekhar Roy aanandshekharroy

👋
View GitHub Profile
Observable.fromArray(1,2,3,4)
.subscribeBy(
onNext = {
if(it==2){
throw (RuntimeException("Exception on 2"))
}
println(it)
},
onComplete = {
println("Completed")
@aanandshekharroy
aanandshekharroy / rxKotlin.kt
Created February 12, 2018 16:52
Simple RxKotlin
Observable.fromArray(1,2,3,4)
.subscribeBy(
onNext = {
println(it)
},
onComplete = {
println("Completed")
},
onError = {
println(it.message)
@aanandshekharroy
aanandshekharroy / ParameterizedUnitTest.kt
Created February 10, 2018 11:04
Used JUnitParams to create parametrized unit test in Kotlin
import junitparams.JUnitParamsRunner
import junitparams.Parameters
import org.junit.Test;
import org.junit.Assert.*;
import org.junit.Before
import org.junit.runner.RunWith
import org.junit.runners.Parameterized
import java.util.*