Merge changes Idf0ce198,Ibd324b78,I6daa38f5,I242402e4 am: 8be3ebd163
am: a5a729f523
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2121199 Change-Id: I2ed62ef98c1e81d6549ba1eb0c271ef3bf61d168 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -52,7 +52,6 @@ import java.util.List;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class UiccSlotUtilTest {
|
||||
private Context mContext;
|
||||
@Mock
|
||||
private TelephonyManager mTelephonyManager;
|
||||
@Mock
|
||||
@@ -61,8 +60,10 @@ public class UiccSlotUtilTest {
|
||||
private static final int ESIM_PHYSICAL_SLOT = 0;
|
||||
private static final int PSIM_PHYSICAL_SLOT = 1;
|
||||
|
||||
private Context mContext;
|
||||
private List<SubscriptionInfo> mSubscriptionInfoList = new ArrayList<>();
|
||||
private List<UiccCardInfo> mUiccCardInfo = new ArrayList<>();
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
@@ -98,7 +99,8 @@ public class UiccSlotUtilTest {
|
||||
public void getEsimSlotId_twoSimSlotsDeviceAndEsimIsSlot0_returnTheCorrectEsimSlot() {
|
||||
when(mTelephonyManager.getUiccSlotsInfo()).thenReturn(
|
||||
twoSimSlotsDeviceActiveEsimActivePsim());
|
||||
int testSlot = UiccSlotUtil.getEsimSlotId(mContext,0);
|
||||
|
||||
int testSlot = UiccSlotUtil.getEsimSlotId(mContext, 0);
|
||||
|
||||
assertThat(testSlot).isEqualTo(0);
|
||||
}
|
||||
@@ -112,6 +114,7 @@ public class UiccSlotUtilTest {
|
||||
mUiccCardInfo.add(createUiccCardInfo(true, cardId, 1, true, -1, -1));
|
||||
when(mTelephonyManager.getUiccSlotsInfo()).thenReturn(
|
||||
twoSimSlotsDeviceActiveEsimActiveRemovableEsim());
|
||||
|
||||
int testSlot = UiccSlotUtil.getEsimSlotId(mContext, subId);
|
||||
|
||||
assertThat(testSlot).isEqualTo(1);
|
||||
@@ -126,6 +129,7 @@ public class UiccSlotUtilTest {
|
||||
mUiccCardInfo.add(createUiccCardInfo(true, cardId, 1, true, -1, -1));
|
||||
when(mTelephonyManager.getUiccSlotsInfo()).thenReturn(
|
||||
twoSimSlotsDeviceActivePsimActiveRemovableEsim());
|
||||
|
||||
int testSlot = UiccSlotUtil.getEsimSlotId(mContext, subId);
|
||||
|
||||
assertThat(testSlot).isEqualTo(1);
|
||||
@@ -135,7 +139,8 @@ public class UiccSlotUtilTest {
|
||||
public void getEsimSlotId_twoSimSlotsDeviceAndEsimIsSlot1_returnTheCorrectEsimSlot() {
|
||||
when(mTelephonyManager.getUiccSlotsInfo()).thenReturn(
|
||||
twoSimSlotsDeviceActivePsimActiveEsim());
|
||||
int testSlot = UiccSlotUtil.getEsimSlotId(mContext,0);
|
||||
|
||||
int testSlot = UiccSlotUtil.getEsimSlotId(mContext, 0);
|
||||
|
||||
assertThat(testSlot).isEqualTo(1);
|
||||
}
|
||||
@@ -144,7 +149,8 @@ public class UiccSlotUtilTest {
|
||||
public void getEsimSlotId_noEimSlotDevice_returnTheCorrectEsimSlot() {
|
||||
when(mTelephonyManager.getUiccSlotsInfo()).thenReturn(
|
||||
oneSimSlotDeviceActivePsim());
|
||||
int testSlot = UiccSlotUtil.getEsimSlotId(mContext,0);
|
||||
|
||||
int testSlot = UiccSlotUtil.getEsimSlotId(mContext, 0);
|
||||
|
||||
assertThat(testSlot).isEqualTo(-1);
|
||||
}
|
||||
|
Reference in New Issue
Block a user