@Test public void shouldUseTheProvidedLocalizerToLocalizeWithArgs() { when(localizer.localize("ME", "for-real")).thenReturn("whateva"); assertThat( LocalizedMessage.string("me", Arrays.asList("for-real")).localize(localizer), is("whateva")); }
@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!")); }
@Test public void shouldUseTheProvidedLocalizerToLocalize() { when(localizer.localize(anyString(), anyVararg())).thenReturn("whateva"); assertThat(LocalizedMessage.string("me").localize(localizer), is("whateva")); }