use of com.android.settings.password.ChooseLockPattern.IntentBuilder in project android_packages_apps_Settings by DirtyUnicorns.
the class ChooseLockPatternTest method intentBuilder_setPattern_shouldAddExtras.
@Test
public void intentBuilder_setPattern_shouldAddExtras() {
Intent intent = new IntentBuilder(application).setPattern("pattern").setUserId(123).build();
assertThat(intent.getBooleanExtra(ChooseLockSettingsHelper.EXTRA_KEY_HAS_CHALLENGE, true)).named("EXTRA_KEY_HAS_CHALLENGE").isFalse();
assertThat(intent.getStringExtra(ChooseLockSettingsHelper.EXTRA_KEY_PASSWORD)).named("EXTRA_KEY_PASSWORD").isEqualTo("pattern");
assertThat(intent.getIntExtra(Intent.EXTRA_USER_ID, 0)).named("EXTRA_USER_ID").isEqualTo(123);
}
use of com.android.settings.password.ChooseLockPattern.IntentBuilder in project android_packages_apps_Settings by SudaMod.
the class ChooseLockPatternTest method intentBuilder_setChallenge_shouldAddExtras.
@Test
public void intentBuilder_setChallenge_shouldAddExtras() {
Intent intent = new IntentBuilder(application).setChallenge(12345L).setUserId(123).build();
assertThat(intent.getBooleanExtra(ChooseLockSettingsHelper.EXTRA_KEY_HAS_CHALLENGE, false)).named("EXTRA_KEY_HAS_CHALLENGE").isTrue();
assertThat(intent.getLongExtra(ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE, 0L)).named("EXTRA_KEY_CHALLENGE").isEqualTo(12345L);
assertThat(intent.getIntExtra(Intent.EXTRA_USER_ID, 0)).named("EXTRA_USER_ID").isEqualTo(123);
}
use of com.android.settings.password.ChooseLockPattern.IntentBuilder in project android_packages_apps_Settings by SudaMod.
the class ChooseLockPatternTest method intentBuilder_setPattern_shouldAddExtras.
@Test
public void intentBuilder_setPattern_shouldAddExtras() {
Intent intent = new IntentBuilder(application).setPattern("pattern").setUserId(123).build();
assertThat(intent.getBooleanExtra(ChooseLockSettingsHelper.EXTRA_KEY_HAS_CHALLENGE, true)).named("EXTRA_KEY_HAS_CHALLENGE").isFalse();
assertThat(intent.getStringExtra(ChooseLockSettingsHelper.EXTRA_KEY_PASSWORD)).named("EXTRA_KEY_PASSWORD").isEqualTo("pattern");
assertThat(intent.getIntExtra(Intent.EXTRA_USER_ID, 0)).named("EXTRA_USER_ID").isEqualTo(123);
}
use of com.android.settings.password.ChooseLockPattern.IntentBuilder in project platform_packages_apps_Settings by BlissRoms.
the class ChooseLockPatternTest method intentBuilder_setPattern_shouldAddExtras.
@Test
public void intentBuilder_setPattern_shouldAddExtras() {
Intent intent = new IntentBuilder(application).setPattern("pattern").setUserId(123).build();
assertThat(intent.getBooleanExtra(ChooseLockSettingsHelper.EXTRA_KEY_HAS_CHALLENGE, true)).named("EXTRA_KEY_HAS_CHALLENGE").isFalse();
assertThat(intent.getStringExtra(ChooseLockSettingsHelper.EXTRA_KEY_PASSWORD)).named("EXTRA_KEY_PASSWORD").isEqualTo("pattern");
assertThat(intent.getIntExtra(Intent.EXTRA_USER_ID, 0)).named("EXTRA_USER_ID").isEqualTo(123);
}
use of com.android.settings.password.ChooseLockPattern.IntentBuilder in project platform_packages_apps_Settings by BlissRoms.
the class ChooseLockPatternTest method intentBuilder_setChallenge_shouldAddExtras.
@Test
public void intentBuilder_setChallenge_shouldAddExtras() {
Intent intent = new IntentBuilder(application).setChallenge(12345L).setUserId(123).build();
assertThat(intent.getBooleanExtra(ChooseLockSettingsHelper.EXTRA_KEY_HAS_CHALLENGE, false)).named("EXTRA_KEY_HAS_CHALLENGE").isTrue();
assertThat(intent.getLongExtra(ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE, 0L)).named("EXTRA_KEY_CHALLENGE").isEqualTo(12345L);
assertThat(intent.getIntExtra(Intent.EXTRA_USER_ID, 0)).named("EXTRA_USER_ID").isEqualTo(123);
}
Aggregations