Added test for SimpleMessageProvider.format(String, Object...).

This commit is contained in:
main() 2012-01-06 17:11:03 +01:00
parent e6c36be019
commit ba6f580fd8

View File

@ -32,6 +32,7 @@ import org.powermock.modules.junit4.PowerMockRunner;
import com.onarandombox.MultiverseCore.MultiverseCore; import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.localization.LazyLocaleMessageProvider; import com.onarandombox.MultiverseCore.localization.LazyLocaleMessageProvider;
import com.onarandombox.MultiverseCore.localization.MultiverseMessage; import com.onarandombox.MultiverseCore.localization.MultiverseMessage;
import com.onarandombox.MultiverseCore.localization.SimpleMessageProvider;
import com.onarandombox.MultiverseCore.test.utils.TestInstanceCreator; import com.onarandombox.MultiverseCore.test.utils.TestInstanceCreator;
@RunWith(PowerMockRunner.class) @RunWith(PowerMockRunner.class)
@ -190,4 +191,11 @@ public class TestLocalization {
// Clean up afterwards: // Clean up afterwards:
assertTrue(file.delete()); assertTrue(file.delete());
} }
@Test
public void testFormat() {
String testString = "%sthisisasimpletest&moretesting&&thatsit.";
String result = SimpleMessageProvider.format(testString, "arg");
assertEquals("argthisisasimpletest\u00A7moretesting&thatsit.", result);
}
} }