Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a6affbb2 authored by tom hsu's avatar tom hsu
Browse files

Fix Test failed of string mismatch

Flag: EXEMPT bug fix
Fix: b/411307762
Test: atest pass
Change-Id: Ib3a49734819f9e3ea3b9ed61af4b6073972d0e4d
parent 3c8e4222
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -21,8 +21,8 @@ import android.telephony.TelephonyManager
import androidx.preference.PreferenceManager
import androidx.preference.PreferenceScreen
import androidx.test.core.app.ApplicationProvider
import com.android.settings.R
import com.android.settings.network.telephony.satellite.SatelliteSettingAboutContentController.Companion.PREF_KEY_ABOUT_SATELLITE_CONNECTIVITY
import com.android.settings.testutils.ResourcesUtils
import com.android.settingslib.widget.TopIntroPreference
import com.google.common.truth.Truth.assertThat
import org.junit.Before
@@ -62,10 +62,13 @@ class SatelliteSettingAboutContentControllerTest {

        controller.displayPreference(screen)

        assertThat(preference.title).isEqualTo(
            "You can send and receive text messages and use some apps by satellite with an eligible Test Carrier account"
        assertThat(preference.title.toString()).isEqualTo(
            ResourcesUtils.getResourcesString(
                context,
                "description_about_satellite_setting",
                TEST_SIM_OPERATOR_NAME
            )
        )

    }

    private companion object {
+7 −6
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;

import com.android.settings.network.CarrierConfigCache;
import com.android.settings.testutils.ResourcesUtils;

import org.junit.Before;
import org.junit.Rule;
@@ -198,8 +199,8 @@ public class SatelliteSettingPreferenceControllerTest {
        preferenceScreen.addPreference(preference);
        mController.displayPreference(preferenceScreen);

        assertThat(preference.getSummary()).isEqualTo(
                "Send and receive text messages by satellite. Contact your carrier for details.");
        assertThat(preference.getSummary()).isEqualTo(ResourcesUtils.getResourcesString(mContext,
                "satellite_setting_summary_without_entitlement"));
    }

    @Test
@@ -219,8 +220,8 @@ public class SatelliteSettingPreferenceControllerTest {
        mController.mCarrierRoamingNtnModeCallback.onCarrierRoamingNtnAvailableServicesChanged(
                new int[]{SERVICE_TYPE_SMS});

        assertThat(preference.getSummary()).isEqualTo(
                "Send and receive text messages by satellite. Included with your account.");
        assertThat(preference.getSummary()).isEqualTo(ResourcesUtils.getResourcesString(mContext,
                        "satellite_setting_enabled_summary"));
    }

    @Test
@@ -243,7 +244,7 @@ public class SatelliteSettingPreferenceControllerTest {
        mController.mCarrierRoamingNtnModeCallback.onCarrierRoamingNtnAvailableServicesChanged(
                new int[]{});

        assertThat(preference.getSummary()).isEqualTo(
                "Send and receive text messages by satellite. Not included with your account.");
        assertThat(preference.getSummary()).isEqualTo(ResourcesUtils.getResourcesString(mContext,
                "satellite_setting_disabled_summary"));
    }
}