@Test public void should_build_mail_0_updates_0() { String title = "Mail: 0 Updates: 0"; InboxResponse inboxResponse = createInboxResponse(0); NotificationsResponse notificationsResponse = createNotificationResponse(0); TitleBuilder titleBuilder = new TitleBuilder(notificationsResponse, inboxResponse, resources); assertEquals(title, titleBuilder.buildCondensed()); }
public String buildCondensed() { String title = ""; if(validNotificationsResponse() && validInboxResponse()) { title = resources.getString(R.string.message_condensed, inboxResponse.count); title += " "; title += resources.getString(R.string.updates_condensed, notificationResponse.count); } else if(validNotificationsResponse()) { title = resources.getString(R.string.updates_condensed, notificationResponse.count); } else if(validInboxResponse()) { title = resources.getString(R.string.message_condensed, inboxResponse.count); } return title; }
TitleBuilder extends UpdateBuilder { public String buildCondensed() { String title = ""; if(validNotificationsResponse() && validInboxResponse()) { title = resources.getString(R.string.message_condensed, inboxResponse.count); title += " "; title += resources.getString(R.string.updates_condensed, notificationResponse.count); } else if(validNotificationsResponse()) { title = resources.getString(R.string.updates_condensed, notificationResponse.count); } else if(validInboxResponse()) { title = resources.getString(R.string.message_condensed, inboxResponse.count); } return title; } }
TitleBuilder extends UpdateBuilder { public String buildCondensed() { String title = ""; if(validNotificationsResponse() && validInboxResponse()) { title = resources.getString(R.string.message_condensed, inboxResponse.count); title += " "; title += resources.getString(R.string.updates_condensed, notificationResponse.count); } else if(validNotificationsResponse()) { title = resources.getString(R.string.updates_condensed, notificationResponse.count); } else if(validInboxResponse()) { title = resources.getString(R.string.message_condensed, inboxResponse.count); } return title; } TitleBuilder(NotificationsResponse notificationsResponse, InboxResponse inboxResponse, Resources resources); }
TitleBuilder extends UpdateBuilder { public String buildCondensed() { String title = ""; if(validNotificationsResponse() && validInboxResponse()) { title = resources.getString(R.string.message_condensed, inboxResponse.count); title += " "; title += resources.getString(R.string.updates_condensed, notificationResponse.count); } else if(validNotificationsResponse()) { title = resources.getString(R.string.updates_condensed, notificationResponse.count); } else if(validInboxResponse()) { title = resources.getString(R.string.message_condensed, inboxResponse.count); } return title; } TitleBuilder(NotificationsResponse notificationsResponse, InboxResponse inboxResponse, Resources resources); String buildCondensed(); String build(); }
TitleBuilder extends UpdateBuilder { public String buildCondensed() { String title = ""; if(validNotificationsResponse() && validInboxResponse()) { title = resources.getString(R.string.message_condensed, inboxResponse.count); title += " "; title += resources.getString(R.string.updates_condensed, notificationResponse.count); } else if(validNotificationsResponse()) { title = resources.getString(R.string.updates_condensed, notificationResponse.count); } else if(validInboxResponse()) { title = resources.getString(R.string.message_condensed, inboxResponse.count); } return title; } TitleBuilder(NotificationsResponse notificationsResponse, InboxResponse inboxResponse, Resources resources); String buildCondensed(); String build();  }