add /rankup noconfirm
This commit is contained in:
@@ -1,5 +0,0 @@
|
||||
package sh.okx.rankup;
|
||||
|
||||
public class RankupCommandsTest extends RankupTest {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package sh.okx.rankup.commands;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
import be.seeseemelk.mockbukkit.entity.PlayerMock;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import sh.okx.rankup.RankupTest;
|
||||
|
||||
public class DisabledNoConfirmCommandTest extends RankupTest {
|
||||
|
||||
public DisabledNoConfirmCommandTest() {
|
||||
super("noconfirm");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNoConfirmDisabled() {
|
||||
PlayerMock player = server.addPlayer();
|
||||
player.addAttachment(plugin, "rankup.rankup", true);
|
||||
player.addAttachment(plugin, "rankup.noconfirm", true);
|
||||
|
||||
plugin.getPermissions().addGroup(player.getUniqueId(), "A");
|
||||
plugin.getEconomy().setPlayer(player, 10000);
|
||||
|
||||
plugin.getCommand("rankup").execute(player, "rankup", new String[] {"noconfirm"});
|
||||
assertFalse(plugin.getPermissions().inGroup(player.getUniqueId(), "B"));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package sh.okx.rankup.commands;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
import be.seeseemelk.mockbukkit.entity.PlayerMock;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import sh.okx.rankup.RankupTest;
|
||||
|
||||
public class EnabledNoConfirmCommandTest extends RankupTest {
|
||||
|
||||
@Test
|
||||
public void testNoConfirmEnabled() {
|
||||
PlayerMock player = server.addPlayer();
|
||||
player.addAttachment(plugin, "rankup.rankup", true);
|
||||
player.addAttachment(plugin, "rankup.noconfirm", true);
|
||||
|
||||
plugin.getPermissions().addGroup(player.getUniqueId(), "A");
|
||||
plugin.getEconomy().setPlayer(player, 10000);
|
||||
|
||||
plugin.getCommand("rankup").execute(player, "rankup", new String[] {"noconfirm"});
|
||||
assertTrue(plugin.getPermissions().inGroup(player.getUniqueId(), "B"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user