Test for string changes in DND Sound Settings

Test: this
Change-Id: I47ba1d1bad6a5be04d718d2e58eaf5dd6c69f107
Fixes: 74529508
This commit is contained in:
Beverly
2018-03-12 14:35:27 -04:00
parent 23612e325b
commit 170b88c6fc

View File

@@ -47,27 +47,12 @@ public class ZenModeSettingsTest {
} }
@Test @Test
public void testGetBehaviorSettingSummary_customBehavior() { public void testGetBehaviorSettingSummary_noSoundsCanBypass() {
NotificationManager.Policy policy = new NotificationManager.Policy(
NotificationManager.Policy.PRIORITY_CATEGORY_EVENTS
| NotificationManager.Policy.PRIORITY_CATEGORY_REMINDERS
| NotificationManager.Policy.PRIORITY_CATEGORY_ALARMS
| NotificationManager.Policy.PRIORITY_CATEGORY_MEDIA,
0, 0);
final String result = mBuilder.getBehaviorSettingSummary(policy,
Settings.Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS);
String custom = mContext.getString(R.string.zen_mode_behavior_summary_custom);
assertEquals(custom, result);
}
@Test
public void testGetBehaviorSettingSummary_totalSilence() {
NotificationManager.Policy policy = new NotificationManager.Policy(0, 0, 0); NotificationManager.Policy policy = new NotificationManager.Policy(0, 0, 0);
final String result = mBuilder.getBehaviorSettingSummary(policy, final String result = mBuilder.getBehaviorSettingSummary(policy,
Settings.Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS); Settings.Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS);
String totalSilence = mContext.getString(R.string.zen_mode_behavior_total_silence); String totalSilence = mContext.getString(R.string.zen_mode_no_exceptions);
assertEquals(totalSilence, result); assertEquals(totalSilence, result);
} }
@@ -80,7 +65,9 @@ public class ZenModeSettingsTest {
final String result = mBuilder.getBehaviorSettingSummary(policy, final String result = mBuilder.getBehaviorSettingSummary(policy,
Settings.Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS); Settings.Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS);
String alarmsAndMedia = mContext.getString(R.string.zen_mode_behavior_alarms_only); String alarmsAndMedia = mContext.getString(R.string.join_two_items,
mContext.getString(R.string.zen_mode_alarms),
mContext.getString(R.string.zen_mode_media).toLowerCase());
assertEquals(alarmsAndMedia, result); assertEquals(alarmsAndMedia, result);
} }