Esempio n. 1
0
 @Test
 public void shouldUseTheProvidedLocalizerToLocalizeWithArgs() {
   when(localizer.localize("ME", "for-real")).thenReturn("whateva");
   assertThat(
       LocalizedMessage.string("me", Arrays.asList("for-real")).localize(localizer),
       is("whateva"));
 }
Esempio n. 2
0
 @Test
 public void shouldUseCapitalizedNoSpaceKeyToFindStringLocalization() throws Exception {
   when(localizer.localize(anyString(), anyVararg())).thenReturn("helped!");
   String s = "Help me";
   assertThat(LocalizedMessage.string(s).localize(localizer), is("helped!"));
 }
Esempio n. 3
0
 @Test
 public void shouldUseTheProvidedLocalizerToLocalize() {
   when(localizer.localize(anyString(), anyVararg())).thenReturn("whateva");
   assertThat(LocalizedMessage.string("me").localize(localizer), is("whateva"));
 }