use of android.support.v7.preference.TwoStatePreference in project android_packages_apps_Settings by DirtyUnicorns.
the class GesturePreferenceControllerTest method updateState_preferenceSetCheckedWhenSettingIsOn.
@Test
public void updateState_preferenceSetCheckedWhenSettingIsOn() {
// Mock a TwoStatePreference
final TwoStatePreference preference = mock(TwoStatePreference.class);
// Set the setting to be enabled.
mController.mIsPrefEnabled = true;
// Run through updateState
mController.updateState(preference);
// Verify pref is checked (as setting is enabled).
verify(preference).setChecked(true);
}
use of android.support.v7.preference.TwoStatePreference in project android_packages_apps_Settings by DirtyUnicorns.
the class GesturePreferenceControllerTest method updateState_preferenceSetUncheckedWhenSettingIsOff.
@Test
public void updateState_preferenceSetUncheckedWhenSettingIsOff() {
// Mock a TwoStatePreference
final TwoStatePreference preference = mock(TwoStatePreference.class);
// Set the setting to be disabled.
mController.mIsPrefEnabled = false;
// Run through updateState
mController.updateState(preference);
// Verify pref is unchecked (as setting is disabled).
verify(preference).setChecked(false);
}
use of android.support.v7.preference.TwoStatePreference in project android_packages_apps_Settings by DirtyUnicorns.
the class PulseNotificationPreferenceControllerTest method updateState_preferenceSetUncheckedWhenSettingIsOff.
@Test
public void updateState_preferenceSetUncheckedWhenSettingIsOff() {
final TwoStatePreference preference = mock(TwoStatePreference.class);
final Context context = ShadowApplication.getInstance().getApplicationContext();
Settings.System.putInt(context.getContentResolver(), NOTIFICATION_LIGHT_PULSE, 0);
mController = new PulseNotificationPreferenceController(context);
mController.updateState(preference);
verify(preference).setChecked(false);
}
use of android.support.v7.preference.TwoStatePreference in project android_packages_apps_Settings by DirtyUnicorns.
the class PulseNotificationPreferenceControllerTest method updateState_preferenceSetCheckedWhenSettingIsOn.
@Test
public void updateState_preferenceSetCheckedWhenSettingIsOn() {
final TwoStatePreference preference = mock(TwoStatePreference.class);
final Context context = ShadowApplication.getInstance().getApplicationContext();
Settings.System.putInt(context.getContentResolver(), NOTIFICATION_LIGHT_PULSE, 1);
mController = new PulseNotificationPreferenceController(context);
mController.updateState(preference);
verify(preference).setChecked(true);
}
use of android.support.v7.preference.TwoStatePreference in project android_packages_apps_Settings by DirtyUnicorns.
the class VibrateWhenRingPreferenceControllerTest method updateState_settingIsOn_preferenceShouldBeChecked.
@Test
public void updateState_settingIsOn_preferenceShouldBeChecked() {
final TwoStatePreference preference = mock(TwoStatePreference.class);
final Context context = ShadowApplication.getInstance().getApplicationContext();
Settings.System.putInt(context.getContentResolver(), VIBRATE_WHEN_RINGING, 1);
mController = new VibrateWhenRingPreferenceController(context);
mController.updateState(preference);
verify(preference).setChecked(true);
}
Aggregations