Fixed tests to use the TextVariables

This commit is contained in:
Florian CUNY 2018-06-03 10:31:22 +02:00
parent 4897d8ef77
commit 884df8f07d
3 changed files with 7 additions and 4 deletions

View File

@ -36,6 +36,7 @@ import org.powermock.reflect.Whitebox;
import us.tastybento.bskyblock.BSkyBlock;
import us.tastybento.bskyblock.Settings;
import us.tastybento.bskyblock.api.localization.TextVariables;
import us.tastybento.bskyblock.api.user.User;
import us.tastybento.bskyblock.commands.IslandCommand;
import us.tastybento.bskyblock.database.objects.Island;
@ -242,7 +243,7 @@ public class IslandBanCommandTest {
assertTrue(ibc.execute(user, Arrays.asList("bill")));
Mockito.verify(user).sendMessage("general.success");
Mockito.verify(targetUser).sendMessage("commands.island.ban.owner-banned-you", "[owner]", user.getName());
Mockito.verify(targetUser).sendMessage("commands.island.ban.owner-banned-you", TextVariables.NAME, user.getName());
}
@Test
@ -263,7 +264,7 @@ public class IslandBanCommandTest {
assertTrue(ibc.execute(user, Arrays.asList("bill")));
Mockito.verify(user).sendMessage("general.success");
Mockito.verify(targetUser).sendMessage("commands.island.ban.owner-banned-you", "[owner]", user.getName());
Mockito.verify(targetUser).sendMessage("commands.island.ban.owner-banned-you", TextVariables.NAME, user.getName());
}
@Test

View File

@ -28,6 +28,7 @@ import org.powermock.reflect.Whitebox;
import us.tastybento.bskyblock.BSkyBlock;
import us.tastybento.bskyblock.Settings;
import us.tastybento.bskyblock.api.localization.TextVariables;
import us.tastybento.bskyblock.api.user.User;
import us.tastybento.bskyblock.commands.IslandCommand;
import us.tastybento.bskyblock.database.objects.Island;
@ -280,7 +281,7 @@ public class IslandResetCommandTest {
// Reset
assertTrue(irc.execute(user, new ArrayList<>()));
Mockito.verify(user).sendMessage("commands.island.reset.confirm", "[label]", "island", "[seconds]", String.valueOf(s.getConfirmationTime()));
Mockito.verify(user).sendMessage("commands.island.reset.confirm", TextVariables.LABEL, "island", TextVariables.NUMBER, String.valueOf(s.getConfirmationTime()));
// Reset confirm
assertTrue(irc.execute(user, Arrays.asList("confirm")));

View File

@ -32,6 +32,7 @@ import org.powermock.reflect.Whitebox;
import us.tastybento.bskyblock.BSkyBlock;
import us.tastybento.bskyblock.Settings;
import us.tastybento.bskyblock.api.localization.TextVariables;
import us.tastybento.bskyblock.api.user.User;
import us.tastybento.bskyblock.commands.IslandCommand;
import us.tastybento.bskyblock.database.objects.Island;
@ -205,7 +206,7 @@ public class IslandUnbanCommandTest {
assertTrue(iubc.execute(user, Arrays.asList("bill")));
Mockito.verify(user).sendMessage("general.success");
Mockito.verify(targetUser).sendMessage("commands.island.unban.you-are-unbanned", "[owner]", user.getName());
Mockito.verify(targetUser).sendMessage("commands.island.unban.you-are-unbanned", TextVariables.NAME, user.getName());
}
@Test