am 6d1f1730: am a7415a4f: am 86f1399e: am ca873924: Always pass account to SendersView.format(...) to mirror real world.
* commit '6d1f1730f3370db05cf2b25357714227f613e5ed':
Always pass account to SendersView.format(...) to mirror real world.
diff --git a/tests/src/com/android/mail/browse/SendersFormattingTests.java b/tests/src/com/android/mail/browse/SendersFormattingTests.java
index 142e04c..cbfb7ac 100644
--- a/tests/src/com/android/mail/browse/SendersFormattingTests.java
+++ b/tests/src/com/android/mail/browse/SendersFormattingTests.java
@@ -87,7 +87,8 @@
final ArrayList<SpannableString> strings = Lists.newArrayList();
assertEquals(0, strings.size());
- SendersView.format(getContext(), conv, "", 100, strings, null, null, null, false, false);
+ final Account account = createAccount();
+ SendersView.format(getContext(), conv, "", 100, strings, null, null, account, false, false);
assertEquals(2, strings.size());
assertNull(strings.get(0));
assertEquals("Something", strings.get(1).toString());
@@ -134,8 +135,9 @@
final ConversationItemViewModel.SenderAvatarModel senderAvatarModel =
new ConversationItemViewModel.SenderAvatarModel();
+ final Account account = createAccount();
SendersView.format(getContext(), conv, "", 100, styledSenders, displayableSenderNames,
- senderAvatarModel, null, false, false);
+ senderAvatarModel, account, false, false);
assertEquals("b@b.com", senderAvatarModel.getEmailAddress());
assertEquals("b", senderAvatarModel.getName());
@@ -152,8 +154,9 @@
final ConversationItemViewModel.SenderAvatarModel senderAvatarModel =
new ConversationItemViewModel.SenderAvatarModel();
+ final Account account = createAccount();
SendersView.format(getContext(), conv, "", 100, styledSenders, displayableSenderNames,
- senderAvatarModel, null, false, false);
+ senderAvatarModel, account, false, false);
assertEquals("c@c.com", senderAvatarModel.getEmailAddress());
assertEquals("c", senderAvatarModel.getName());
@@ -193,8 +196,8 @@
SendersView.format(getContext(), conv, "", 100, styledSenders, displayableSenderNames,
senderAvatarModel, account, false, false);
- assertEquals("fflinstone@example.com", senderAvatarModel.getEmailAddress());
- assertEquals("Fred Flinstone", senderAvatarModel.getName());
+ assertEquals("fflintstone@example.com", senderAvatarModel.getEmailAddress());
+ assertEquals("Fred Flintstone", senderAvatarModel.getName());
}
/**
@@ -211,8 +214,9 @@
final ConversationItemViewModel.SenderAvatarModel senderAvatarModel =
new ConversationItemViewModel.SenderAvatarModel();
+ final Account account = createAccount();
SendersView.format(getContext(), conv, "", 100, styledSenders, displayableSenderNames,
- senderAvatarModel, null, false, false);
+ senderAvatarModel, account, false, false);
assertEquals(2, displayableSenderNames.size());
assertEquals("Andrew", displayableSenderNames.get(0));
@@ -222,8 +226,8 @@
private static Account createAccount() {
try {
final Map<String, Object> map = new HashMap<>(2);
- map.put(UIProvider.AccountColumns.NAME, "Fred Flinstone");
- map.put(UIProvider.AccountColumns.ACCOUNT_MANAGER_NAME, "fflinstone@example.com");
+ map.put(UIProvider.AccountColumns.NAME, "Fred Flintstone");
+ map.put(UIProvider.AccountColumns.ACCOUNT_MANAGER_NAME, "fflintstone@example.com");
map.put(UIProvider.AccountColumns.TYPE, "IMAP");
map.put(UIProvider.AccountColumns.PROVIDER_VERSION, 1);
map.put(UIProvider.AccountColumns.CAPABILITIES, 0);