Created
October 9, 2017 09:32
-
-
Save fbcbl/56925bac8517c691ea39ed3b3d42e8a0 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
package testing.fabiocarballo.com.myapplication | |
import com.nhaarman.mockito_kotlin.mock | |
import com.nhaarman.mockito_kotlin.verify | |
import com.nhaarman.mockito_kotlin.whenever | |
import org.junit.Test | |
class TemperaturePresenterTest { | |
val locationProvider: LocationProvider = mock() | |
val temperatureProvider: TemperatureProvider = mock() | |
val view: View = mock() | |
val tested = TemperaturePresenter(locationProvider, temperatureProvider, view) | |
@Test | |
fun `correct temperature is displayed in view`() { | |
whenever(locationProvider.getLocationISOCode()).then { "PT" } | |
whenever(temperatureProvider.getCelsiusTemperatureAt("PT")).thenReturn(21.0f) | |
tested.start() | |
verify(view).displayTemperature(21.0f, "PT") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment