mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-02 06:28:49 +00:00
Add more tests for adventure
This commit is contained in:
1 parent
ac88417b5a
commit
3bc2982e59
1 file changed
+26
@@ -53,6 +53,32 @@ public class BukkitPluginTests {
|
||||
Assertions.assertNotNull(BukkitPlayer.adapt(player));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMessageFormatting() {
|
||||
PlayerMock player = server.addPlayer();
|
||||
|
||||
final MineDown simpleLocale = plugin.getLocales()
|
||||
.getLocale("error_in_game_only")
|
||||
.orElseThrow(() -> new HuskHomesException("Failed to load locale"));
|
||||
final String simpleLocaleText = plugin.getLocales().getRawLocale("error_in_game_only")
|
||||
.orElseThrow(() -> new HuskHomesException("Failed to load raw locale"));
|
||||
BukkitPlayer.adapt(player).sendMessage(simpleLocale);
|
||||
player.assertSaid(simpleLocaleText);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMessageDispatching() {
|
||||
PlayerMock player = server.addPlayer();
|
||||
|
||||
final MineDown locale = plugin.getLocales()
|
||||
.getLocale("teleporting_action_bar_warmup", Integer.toString(3))
|
||||
.orElseThrow(() -> new HuskHomesException("Failed to load locale"));
|
||||
BukkitPlayer.adapt(player).sendActionBar(locale);
|
||||
BukkitPlayer.adapt(player).sendMessage(locale);
|
||||
BukkitPlayer.adapt(player).sendTitle(locale, false);
|
||||
BukkitPlayer.adapt(player).sendTitle(locale, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLocalesLoading() {
|
||||
final Map<String, String> rawLocales = plugin.getLocales().rawLocales;
|
||||
|
||||
Reference in new issue
Block a user