Sergio Crespo Toubes
02/22/2019, 9:32 AMverify(exactly = 1) { mView.showLocations(any()) }
// Reset verify
locationListPresenter.onFilterTextChanged(text)
verify(exactly = 1) { mView.showLocations(any()) }
i am with this isolationMode IsolationMode.InstancePerLeaf
oleksiyp
02/24/2019, 1:46 PMSergio Crespo Toubes
02/25/2019, 1:04 PMGiven("filter") {
val locationListPresenter = LocationListPresenter(mView, mLocationManager, true)
When("text changed") {
val text = "test"
verify(exactly = 1) { mView.showLocations(any()) }
verify(exactly = 1) { mView.setSelectedItem(any()) }
locationListPresenter.onFilterTextChanged(text)
Then("store user first time") {
verify(exactly = 2) { mView.showLocations(any()) }
verify(exactly = 2) { mView.setSelectedItem(any()) }
}
}
}
No problem @oleksiyp. This is my solution... like LocationListPresenter call the same methods i had to verify two times the methods calls.