Skip to content

Commit

Permalink
fix: capture correct argument in reverseSearch tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lazarinibruno committed Dec 18, 2024
1 parent 2423369 commit 839f6af
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class LocationViewModelTest {
fun reverseSearchSuccessfulUpdatesAddress() = runTest {
// Simulate successful repository call
doAnswer {
val successCallback = it.getArgument<(String) -> Unit>(1)
val successCallback = it.getArgument<(String) -> Unit>(2)
successCallback(mockAddressName)
}
.whenever(locationRepository)
Expand All @@ -125,7 +125,7 @@ class LocationViewModelTest {
fun reverseSearchFailureDoesNotCrash() = runTest {
// Simulate failure in the repository call
doAnswer {
val failureCallback = it.getArgument<(Exception) -> Unit>(2)
val failureCallback = it.getArgument<(Exception) -> Unit>(3)
failureCallback(RuntimeException("Network error"))
}
.whenever(locationRepository)
Expand Down

0 comments on commit 839f6af

Please sign in to comment.