use of androidx.appcompat.app.AlertDialog in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class SetupSkipDialogTest method dialogMessage_whenSkipPatternSetupForFingerprint_shouldShownCorrectly.
@Test
public void dialogMessage_whenSkipPatternSetupForFingerprint_shouldShownCorrectly() {
SetupSkipDialog setupSkipDialog = SetupSkipDialog.newInstance(true, true, false, true, false);
setupSkipDialog.show(mActivity.getSupportFragmentManager());
AlertDialog alertDialog = ShadowAlertDialogCompat.getLatestAlertDialog();
assertThat(alertDialog).isNotNull();
ShadowAlertDialogCompat shadowAlertDialog = ShadowAlertDialogCompat.shadowOf(alertDialog);
assertThat(mActivity.getString(R.string.lock_screen_pattern_skip_title)).isEqualTo(shadowAlertDialog.getTitle());
assertThat(getSkipDialogMessage(true)).isEqualTo(shadowAlertDialog.getMessage());
}
use of androidx.appcompat.app.AlertDialog in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class SetupSkipDialogTest method dialogMessage_whenSkipPatternSetupForFace_shouldShownCorrectly.
@Test
public void dialogMessage_whenSkipPatternSetupForFace_shouldShownCorrectly() {
SetupSkipDialog setupSkipDialog = SetupSkipDialog.newInstance(true, true, false, false, true);
setupSkipDialog.show(mActivity.getSupportFragmentManager());
AlertDialog alertDialog = ShadowAlertDialogCompat.getLatestAlertDialog();
assertThat(alertDialog).isNotNull();
ShadowAlertDialogCompat shadowAlertDialog = ShadowAlertDialogCompat.shadowOf(alertDialog);
assertThat(mActivity.getString(R.string.lock_screen_pattern_skip_title)).isEqualTo(shadowAlertDialog.getTitle());
assertThat(getSkipDialogMessage(false)).isEqualTo(shadowAlertDialog.getMessage());
}
use of androidx.appcompat.app.AlertDialog in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class SetupSkipDialogTest method dialogMessage_whenSkipPasswordSetupForFace_shouldShownCorrectly.
@Test
public void dialogMessage_whenSkipPasswordSetupForFace_shouldShownCorrectly() {
SetupSkipDialog setupSkipDialog = SetupSkipDialog.newInstance(true, false, true, false, true);
setupSkipDialog.show(mActivity.getSupportFragmentManager());
AlertDialog alertDialog = ShadowAlertDialogCompat.getLatestAlertDialog();
assertThat(alertDialog).isNotNull();
ShadowAlertDialogCompat shadowAlertDialog = ShadowAlertDialogCompat.shadowOf(alertDialog);
assertThat(mActivity.getString(R.string.lock_screen_password_skip_title)).isEqualTo(shadowAlertDialog.getTitle());
assertThat(getSkipDialogMessage(false)).isEqualTo(shadowAlertDialog.getMessage());
}
use of androidx.appcompat.app.AlertDialog in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class NetworkRequestDialogFragmentTest method onUserSelectionCallbackRegistration_onClick_shouldCallSelect.
@Test
public void onUserSelectionCallbackRegistration_onClick_shouldCallSelect() {
// Assert.
final int indexClickItem = 3;
List<AccessPoint> accessPointList = createAccessPointList();
AccessPoint clickedAccessPoint = accessPointList.get(indexClickItem);
clickedAccessPoint.generateOpenNetworkConfig();
when(networkRequestDialogFragment.getAccessPointList()).thenReturn(accessPointList);
NetworkRequestUserSelectionCallback selectionCallback = mock(NetworkRequestUserSelectionCallback.class);
AlertDialog dialog = mock(AlertDialog.class);
networkRequestDialogFragment.onUserSelectionCallbackRegistration(selectionCallback);
// Act.
networkRequestDialogFragment.onClick(dialog, indexClickItem);
// Check.
verify(selectionCallback, times(1)).select(clickedAccessPoint.getConfig());
}
use of androidx.appcompat.app.AlertDialog in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class ListWithEntrySummaryPreferenceTest method setEntries_customEntries_shouldUpdateEntries.
@Test
public void setEntries_customEntries_shouldUpdateEntries() {
mPreference.setEntries(mCustomEntries);
mPreference.setEntryValues(mCustomEntryValues);
mPreference.setEntrySummaries(mCustomEntrySummaries);
AlertDialog dialog = showDialog(mPreference);
ListAdapter adapter = dialog.getListView().getAdapter();
int len = mCustomEntries.length;
assertThat(adapter.getCount()).isEqualTo(len);
for (int i = 0; i < len; i++) {
TextView title = adapter.getView(i, null, null).findViewById(R.id.title);
TextView summary = adapter.getView(i, null, null).findViewById(R.id.summary);
assertThat(title.getText()).isEqualTo(mCustomEntries[i]);
assertThat(summary.getText()).isEqualTo(mCustomEntrySummaries[i]);
}
}
Aggregations