CallFormatter { public String callTypeString(int callType, String name) { if (name == null) { return resources.getString(mapCallType(callType)); } else { return resources.getString(mapTextCallType(callType), name); } } CallFormatter(Resources resources); String format(int callType, String number, int duration); String formatForCalendar(int callType, String number, int duration); String formattedCallDuration(int duration); String callTypeString(int callType, String name);  }
@Test public void shouldFormatCallIncoming() throws Exception { assertThat(formatter.callTypeString(CallLog.Calls.INCOMING_TYPE, "Foo")).isEqualTo("Call from Foo"); }
@Test public void shouldFormatCallOutgoing() throws Exception { assertThat(formatter.callTypeString(CallLog.Calls.OUTGOING_TYPE, "Foo")).isEqualTo("Called Foo"); }
@Test public void shouldFormatCallMissed() throws Exception { assertThat(formatter.callTypeString(CallLog.Calls.MISSED_TYPE, "Foo")).isEqualTo("Missed call from Foo"); }