Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
shah272728 committed Sep 29, 2023
1 parent ec14d40 commit 7c40e6d
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import org.robolectric.RobolectricTestRunner
class MarkerEnumTest : BaseTest() {
@Test
fun `Enum values should be correctly defined`() {
// Assert that the enum values are defined as expected
assertEquals("NONE", MarkerEnum.NONE.name)
assertEquals("DIRECTION_ICON", MarkerEnum.DIRECTION_ICON.name)
assertEquals("ORIGIN_ICON", MarkerEnum.ORIGIN_ICON.name)
Expand All @@ -23,7 +22,6 @@ class MarkerEnumTest : BaseTest() {

@Test
fun `Enum values should have the correct ordinal`() {
// Assert that the enum values have the expected ordinal values
assertEquals(0, MarkerEnum.NONE.ordinal)
assertEquals(1, MarkerEnum.DIRECTION_ICON.ordinal)
assertEquals(2, MarkerEnum.ORIGIN_ICON.ordinal)
Expand All @@ -34,7 +32,6 @@ class MarkerEnumTest : BaseTest() {

@Test
fun `Enum values should be retrievable by their names`() {
// Assert that you can retrieve enum values by their names
assertEquals(MarkerEnum.NONE, MarkerEnum.valueOf("NONE"))
assertEquals(MarkerEnum.DIRECTION_ICON, MarkerEnum.valueOf("DIRECTION_ICON"))
assertEquals(MarkerEnum.ORIGIN_ICON, MarkerEnum.valueOf("ORIGIN_ICON"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class RedirectionTypeTest {

@Test
fun `Enum values should be correctly defined`() {
// Assert that the enum values are defined as expected
assertEquals("ROUTE_OPTION", RedirectionType.ROUTE_OPTION.name)
assertEquals("SEARCH_DIRECTION_CAR", RedirectionType.SEARCH_DIRECTION_CAR.name)
assertEquals("MY_LOCATION", RedirectionType.MY_LOCATION.name)
Expand All @@ -20,7 +19,6 @@ class RedirectionTypeTest {

@Test
fun `Enum values should have the correct ordinal`() {
// Assert that the enum values have the expected ordinal values
assertEquals(0, RedirectionType.ROUTE_OPTION.ordinal)
assertEquals(1, RedirectionType.SEARCH_DIRECTION_CAR.ordinal)
assertEquals(2, RedirectionType.MY_LOCATION.ordinal)
Expand All @@ -29,7 +27,6 @@ class RedirectionTypeTest {

@Test
fun `Enum values should be retrievable by their names`() {
// Assert that you can retrieve enum values by their names
assertEquals(RedirectionType.ROUTE_OPTION, RedirectionType.valueOf("ROUTE_OPTION"))
assertEquals(RedirectionType.SEARCH_DIRECTION_CAR, RedirectionType.valueOf("SEARCH_DIRECTION_CAR"))
assertEquals(RedirectionType.MY_LOCATION, RedirectionType.valueOf("MY_LOCATION"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,18 @@ class SearchApiEnumTest {

@Test
fun `Enum values should be correctly defined`() {
// Assert that the enum values are defined as expected
assertEquals("SEARCH_PLACE_SUGGESTION", SearchApiEnum.SEARCH_PLACE_SUGGESTION.name)
assertEquals("SEARCH_PLACE_INDEX_TEXT", SearchApiEnum.SEARCH_PLACE_INDEX_TEXT.name)
}

@Test
fun `Enum values should have the correct ordinal`() {
// Assert that the enum values have the expected ordinal values
assertEquals(0, SearchApiEnum.SEARCH_PLACE_SUGGESTION.ordinal)
assertEquals(1, SearchApiEnum.SEARCH_PLACE_INDEX_TEXT.ordinal)
}

@Test
fun `Enum values should be retrievable by their names`() {
// Assert that you can retrieve enum values by their names
assertEquals(SearchApiEnum.SEARCH_PLACE_SUGGESTION, SearchApiEnum.valueOf("SEARCH_PLACE_SUGGESTION"))
assertEquals(SearchApiEnum.SEARCH_PLACE_INDEX_TEXT, SearchApiEnum.valueOf("SEARCH_PLACE_INDEX_TEXT"))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,20 @@ class TabEnumTest {

@Test
fun `Enum values should be correctly defined`() {
// Assert that the enum values are defined as expected
assertEquals("TAB_EXPLORE", TabEnum.TAB_EXPLORE.name)
assertEquals("TAB_TRACKING", TabEnum.TAB_TRACKING.name)
assertEquals("TAB_GEOFENCE", TabEnum.TAB_GEOFENCE.name)
}

@Test
fun `Enum values should have the correct ordinal`() {
// Assert that the enum values have the expected ordinal values
assertEquals(0, TabEnum.TAB_EXPLORE.ordinal)
assertEquals(1, TabEnum.TAB_TRACKING.ordinal)
assertEquals(2, TabEnum.TAB_GEOFENCE.ordinal)
}

@Test
fun `Enum values should be retrievable by their names`() {
// Assert that you can retrieve enum values by their names
assertEquals(TabEnum.TAB_EXPLORE, TabEnum.valueOf("TAB_EXPLORE"))
assertEquals(TabEnum.TAB_TRACKING, TabEnum.valueOf("TAB_TRACKING"))
assertEquals(TabEnum.TAB_GEOFENCE, TabEnum.valueOf("TAB_GEOFENCE"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,18 @@ class TrackingEnumTest {

@Test
fun `Enum values should be correctly defined`() {
// Assert that the enum values are defined as expected
assertEquals("ENABLE_TRACKING", TrackingEnum.ENABLE_TRACKING.name)
assertEquals("TRACKING_HISTORY", TrackingEnum.TRACKING_HISTORY.name)
}

@Test
fun `Enum values should have the correct ordinal`() {
// Assert that the enum values have the expected ordinal values
assertEquals(0, TrackingEnum.ENABLE_TRACKING.ordinal)
assertEquals(1, TrackingEnum.TRACKING_HISTORY.ordinal)
}

@Test
fun `Enum values should be retrievable by their names`() {
// Assert that you can retrieve enum values by their names
assertEquals(TrackingEnum.ENABLE_TRACKING, TrackingEnum.valueOf("ENABLE_TRACKING"))
assertEquals(TrackingEnum.TRACKING_HISTORY, TrackingEnum.valueOf("TRACKING_HISTORY"))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ class GeneralUtilCheckGeofenceInsideGrabTest : BaseTest() {

@Test
fun testIsGrabMapSelectedTrueAndInsideGeofence() {
val latLng = LatLng(40.0, -75.0) // Inside the geofence

// Set the condition to true for isGrabMapSelected
val latLng = LatLng(40.0, -75.0)
val mPreferenceManager = PreferenceManager(context)
mPreferenceManager.setValue(KEY_USER_REGION, SE_REGION)

Expand All @@ -72,9 +70,7 @@ class GeneralUtilCheckGeofenceInsideGrabTest : BaseTest() {

@Test
fun testIsGrabMapSelectedTrueAndOutsideGeofence() {
val latLng = LatLng(45.0, -80.0) // Outside the geofence

// Set the condition to true for isGrabMapSelected
val latLng = LatLng(45.0, -80.0)
val mPreferenceManager = PreferenceManager(context)
mPreferenceManager.setValue(KEY_USER_REGION, SE_REGION)

Expand All @@ -85,9 +81,7 @@ class GeneralUtilCheckGeofenceInsideGrabTest : BaseTest() {

@Test
fun testIsGrabMapSelectedFalse() {
val latLng = LatLng(40.0, -75.0) // Inside or outside, doesn't matter

// Set the condition to false for isGrabMapSelected
val latLng = LatLng(40.0, -75.0)
val mPreferenceManager = PreferenceManager(context)
mPreferenceManager.setValue(KEY_USER_REGION, UNIT_AMPLIFY_JSON_CONF_INPUT_REGION)

Expand All @@ -99,8 +93,7 @@ class GeneralUtilCheckGeofenceInsideGrabTest : BaseTest() {
@Test
fun testContextNull() {
val mContext: Context? = null
val latLng = LatLng(40.0, -75.0) // Inside or outside, doesn't matter
// Set the condition to false for isGrabMapSelected
val latLng = LatLng(40.0, -75.0)
val mPreferenceManager = PreferenceManager(context)
mPreferenceManager.setValue(KEY_USER_REGION, UNIT_AMPLIFY_JSON_CONF_INPUT_REGION)
val result = checkGeofenceInsideGrab(latLng, mPreferenceManager, mContext)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.aws.amazonlocation.utils.units

import com.aws.amazonlocation.BaseTest
import com.aws.amazonlocation.BuildConfig
import com.aws.amazonlocation.mock.* // ktlint-disable no-wildcard-imports
import com.aws.amazonlocation.mock.TEST_FAILED_DUE_TO_INCORRECT_DATA
import com.aws.amazonlocation.utils.Units
import org.junit.Assert
import org.junit.Test
Expand Down

0 comments on commit 7c40e6d

Please sign in to comment.