Methods Summary |
---|
private void | assertStringArrayEquals(java.lang.String message, java.lang.String[] expected, java.lang.String[] result)
String expectedString = Arrays.toString(expected);
String resultString = Arrays.toString(result);
assertEquals(message + ": arrays differ", expectedString, resultString);
|
public void | testCharSequenceArrayList()
Bundle bundle = new Bundle();
String[] expected = { "foo", "bar", "baz" };
final ArrayList<CharSequence> stringArrayList =
new ArrayList<CharSequence>(expected.length);
for (int i = 0; i < expected.length; i++) {
stringArrayList.add(new SpannableString(expected[i]));
}
bundle.putCharSequenceArrayList(Notification.EXTRA_PEOPLE, stringArrayList);
String[] result = ValidateNotificationPeople.getExtraPeople(bundle);
assertStringArrayEquals("testCharSequenceArrayList", expected, result);
|
public void | testCharSequenceArrayMultiple()
Bundle bundle = new Bundle();
String[] expected = { "foo", "bar", "baz" };
CharSequence[] charSeqArray = new CharSequence[expected.length];
for (int i = 0; i < expected.length; i++) {
charSeqArray[i] = new SpannableString(expected[i]);
}
bundle.putCharSequenceArray(Notification.EXTRA_PEOPLE, charSeqArray);
String[] result = ValidateNotificationPeople.getExtraPeople(bundle);
assertStringArrayEquals("testCharSequenceArrayMultiple", expected, result);
|
public void | testMixedCharSequenceArrayList()
Bundle bundle = new Bundle();
String[] expected = { "foo", "bar", "baz" };
CharSequence[] charSeqArray = new CharSequence[expected.length];
for (int i = 0; i < expected.length; i++) {
if (i % 2 == 0) {
charSeqArray[i] = expected[i];
} else {
charSeqArray[i] = new SpannableString(expected[i]);
}
}
bundle.putCharSequenceArray(Notification.EXTRA_PEOPLE, charSeqArray);
String[] result = ValidateNotificationPeople.getExtraPeople(bundle);
assertStringArrayEquals("testMixedCharSequenceArrayList", expected, result);
|
public void | testNoExtra()
Bundle bundle = new Bundle();
String[] result = ValidateNotificationPeople.getExtraPeople(bundle);
assertNull("lack of extra should return null", result);
|
public void | testSingleCharArray()
String[] expected = { "foobar" };
Bundle bundle = new Bundle();
bundle.putCharArray(Notification.EXTRA_PEOPLE, expected[0].toCharArray());
String[] result = ValidateNotificationPeople.getExtraPeople(bundle);
assertStringArrayEquals("char[] should be in result[0]", expected, result);
|
public void | testSingleCharSequence()
String[] expected = { "foobar" };
Bundle bundle = new Bundle();
bundle.putCharSequence(Notification.EXTRA_PEOPLE, new SpannableString(expected[0]));
String[] result = ValidateNotificationPeople.getExtraPeople(bundle);
assertStringArrayEquals("charSequence should be in result[0]", expected, result);
|
public void | testSingleString()
String[] expected = { "foobar" };
Bundle bundle = new Bundle();
bundle.putString(Notification.EXTRA_PEOPLE, expected[0]);
String[] result = ValidateNotificationPeople.getExtraPeople(bundle);
assertStringArrayEquals("string should be in result[0]", expected, result);
|
public void | testStringArrayList()
Bundle bundle = new Bundle();
String[] expected = { "foo", null, "baz" };
final ArrayList<String> stringArrayList = new ArrayList<String>(expected.length);
for (int i = 0; i < expected.length; i++) {
stringArrayList.add(expected[i]);
}
bundle.putStringArrayList(Notification.EXTRA_PEOPLE, stringArrayList);
String[] result = ValidateNotificationPeople.getExtraPeople(bundle);
assertStringArrayEquals("testStringArrayList", expected, result);
|
public void | testStringArrayMultiple()
Bundle bundle = new Bundle();
String[] expected = { "foo", "bar", "baz" };
bundle.putStringArray(Notification.EXTRA_PEOPLE, expected);
String[] result = ValidateNotificationPeople.getExtraPeople(bundle);
assertStringArrayEquals("testStringArrayMultiple", expected, result);
|
public void | testStringArrayNulls()
Bundle bundle = new Bundle();
String[] expected = { "foo", null, "baz" };
bundle.putStringArray(Notification.EXTRA_PEOPLE, expected);
String[] result = ValidateNotificationPeople.getExtraPeople(bundle);
assertStringArrayEquals("testStringArrayNulls", expected, result);
|
public void | testStringArraySingle()
Bundle bundle = new Bundle();
String[] expected = { "foobar" };
bundle.putStringArray(Notification.EXTRA_PEOPLE, expected);
String[] result = ValidateNotificationPeople.getExtraPeople(bundle);
assertStringArrayEquals("wrapped string should be in result[0]", expected, result);
|