From 839f6afeeee14df106f16598333aed1ef78a6903 Mon Sep 17 00:00:00 2001 From: Bruno Lazarini Sigg Date: Wed, 18 Dec 2024 12:58:42 +0100 Subject: [PATCH] fix: capture correct argument in reverseSearch tests --- .../periodpals/model/location/LocationViewModelTest.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/test/java/com/android/periodpals/model/location/LocationViewModelTest.kt b/app/src/test/java/com/android/periodpals/model/location/LocationViewModelTest.kt index 18a10969..6f829d46 100644 --- a/app/src/test/java/com/android/periodpals/model/location/LocationViewModelTest.kt +++ b/app/src/test/java/com/android/periodpals/model/location/LocationViewModelTest.kt @@ -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) @@ -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)