radityagumay
04/21/2018, 2:42 AMwhenever
or on
block.
because
repository.fetchWeather() willReturnSingle weatherData // this weatherData from fixture
presenter.fetchWeather()
should be done in whenever or on blockartem_zin
04/21/2018, 6:21 AMwhenever
? There is a change you're calling Kotlin Mockito function by mistake
1. Highly recommend wrap `val`s into memoized {}
to properly reset them for each test
1. What is then
? Also looks like Kotlin Mockitoradityagumay
04/21/2018, 6:29 AMon
and it
which I created. Those are not Mockito property.
That's make structure more elegant.
given {
whenever {
then {
}
}
}
instead of
given {
on {
it {
}
}
}
https://github.com/spekframework/spek-android-example/blob/c8826153b49f991babbca45e58dff5be39476d36/app/src/test/kotlin/org/spekframework/speksample/SpekStandard.ktradityagumay
04/21/2018, 6:33 AMradityagumay
04/23/2018, 9:46 AM