AndroidLabelGenerator implements MediaFormatter.ILabelGenerator { @Override public CharSequence get(PhotoPropertiesFormatter.FieldID id) { switch (id) { case dateTimeTaken: return getString2(R.string.lbl_date); case title: return getString2(R.string.lbl_title); case description: return getString2(R.string.lbl_description); case latitude_longitude: return getString2(R.string.lbl_latitude_short) + "/" + context.getString(R.string.lbl_longitude_short) + " "; case rating: return getString2(R.string.lbl_rating); case visibility: return getString2(R.string.lbl_image_visibility); case tags: return getString2(R.string.lbl_tag); case find: return getString2(R.string.lbl_any); case lastModified: return getString2(R.string.sort_by_modification); case path: return getString2(R.string.lbl_path); case clasz: return ""; default: throw new RuntimeException("undefined get(" + id + ")"); } } AndroidLabelGenerator(final Context context, String fieldPrefix); @Override CharSequence get(PhotoPropertiesFormatter.FieldID id);  }
@Test public void shouldHaveCompleteTranslations() { Context mockedContext = mock(Context.class); when(mockedContext.getString(Matchers.anyInt())).thenReturn("res" ); AndroidLabelGenerator sut = new AndroidLabelGenerator(mockedContext, "\n"); for (PhotoPropertiesFormatter.FieldID id : PhotoPropertiesFormatter.FieldID.values()) { sut.get(id); } }