Loading cardinal-android/app/src/main/java/earth/maps/cardinal/routing/FerrostarWrapperRepository.kt +55 −59 Original line number Diff line number Diff line Loading @@ -70,8 +70,6 @@ class FerrostarWrapperRepository @Inject constructor( } fun setValhallaEndpoint(endpoint: String) { thread { Thread.sleep(30000) _walking = FerrostarWrapper( context, locationRepository, Loading Loading @@ -129,8 +127,6 @@ class FerrostarWrapperRepository @Inject constructor( _isInitialized.value = true } // Apply pending options synchronized(pendingOptions) { pendingOptions.forEach { (mode, options) -> Loading cardinal-android/app/src/test/java/earth/maps/cardinal/ui/directions/DirectionsViewModelTest.kt +22 −0 Original line number Diff line number Diff line /* * Cardinal Maps * Copyright (C) 2025 Cardinal Maps Authors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. */ package earth.maps.cardinal.ui.directions import earth.maps.cardinal.MainCoroutineRule Loading Loading @@ -95,6 +113,8 @@ class DirectionsViewModelTest { ) coEvery { mockRoutingProfileRepository.getProfilesForMode(any()) } returns flowOf(emptyList()) // Mock FerrostarWrapperRepository coEvery { mockFerrostarWrapperRepository.awaitInitialization() } returns Unit coEvery { mockFerrostarWrapperRepository.resetOptionsToDefaultsForMode(any()) } returns Unit viewModel = DirectionsViewModel( Loading Loading @@ -253,6 +273,8 @@ class DirectionsViewModelTest { address = null ) mockFerrostarWrapperRepository.awaitInitialization() // Setup mock to throw an exception val mockFerrostarWrapper = mockk<FerrostarWrapper>() coEvery { mockFerrostarWrapperRepository.driving } returns mockFerrostarWrapper Loading Loading
cardinal-android/app/src/main/java/earth/maps/cardinal/routing/FerrostarWrapperRepository.kt +55 −59 Original line number Diff line number Diff line Loading @@ -70,8 +70,6 @@ class FerrostarWrapperRepository @Inject constructor( } fun setValhallaEndpoint(endpoint: String) { thread { Thread.sleep(30000) _walking = FerrostarWrapper( context, locationRepository, Loading Loading @@ -129,8 +127,6 @@ class FerrostarWrapperRepository @Inject constructor( _isInitialized.value = true } // Apply pending options synchronized(pendingOptions) { pendingOptions.forEach { (mode, options) -> Loading
cardinal-android/app/src/test/java/earth/maps/cardinal/ui/directions/DirectionsViewModelTest.kt +22 −0 Original line number Diff line number Diff line /* * Cardinal Maps * Copyright (C) 2025 Cardinal Maps Authors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. */ package earth.maps.cardinal.ui.directions import earth.maps.cardinal.MainCoroutineRule Loading Loading @@ -95,6 +113,8 @@ class DirectionsViewModelTest { ) coEvery { mockRoutingProfileRepository.getProfilesForMode(any()) } returns flowOf(emptyList()) // Mock FerrostarWrapperRepository coEvery { mockFerrostarWrapperRepository.awaitInitialization() } returns Unit coEvery { mockFerrostarWrapperRepository.resetOptionsToDefaultsForMode(any()) } returns Unit viewModel = DirectionsViewModel( Loading Loading @@ -253,6 +273,8 @@ class DirectionsViewModelTest { address = null ) mockFerrostarWrapperRepository.awaitInitialization() // Setup mock to throw an exception val mockFerrostarWrapper = mockk<FerrostarWrapper>() coEvery { mockFerrostarWrapperRepository.driving } returns mockFerrostarWrapper Loading