From e4cf1a158d4a991308621acdf0f47c85dced48cd Mon Sep 17 00:00:00 2001 From: Akshay Nandwana Date: Tue, 25 Jun 2024 03:30:02 +0530 Subject: [PATCH] Added CaptureLocationTaskMapViewModel UnitTest (#2511) * added unit test * updated test and added license * removed test * updated licenseyear * import fix --- .../CaptureLocationTaskMapViewModelTest.kt | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 ground/src/test/java/com/google/android/ground/ui/datacollection/tasks/location/CaptureLocationTaskMapViewModelTest.kt diff --git a/ground/src/test/java/com/google/android/ground/ui/datacollection/tasks/location/CaptureLocationTaskMapViewModelTest.kt b/ground/src/test/java/com/google/android/ground/ui/datacollection/tasks/location/CaptureLocationTaskMapViewModelTest.kt new file mode 100644 index 0000000000..61070b613b --- /dev/null +++ b/ground/src/test/java/com/google/android/ground/ui/datacollection/tasks/location/CaptureLocationTaskMapViewModelTest.kt @@ -0,0 +1,38 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.android.ground.ui.datacollection.tasks.location + +import com.google.android.ground.BaseHiltTest +import com.google.android.ground.ui.common.MapConfig +import com.google.common.truth.Truth.assertThat +import dagger.hilt.android.testing.HiltAndroidTest +import javax.inject.Inject +import org.junit.Test +import org.junit.runner.RunWith +import org.robolectric.RobolectricTestRunner + +@HiltAndroidTest +@RunWith(RobolectricTestRunner::class) +class CaptureLocationTaskMapViewModelTest : BaseHiltTest() { + + @Inject lateinit var captureLocationTaskMapViewModel: CaptureLocationTaskMapViewModel + + @Test + fun testGetMapConfig() { + assertThat(captureLocationTaskMapViewModel.mapConfig) + .isEqualTo(MapConfig(showOfflineImagery = true, allowGestures = false)) + } +}