use of commands.model.Command in project KaellyBot by Kaysoro.
the class CommandPatternTest method testJobCommand.
public void testJobCommand() {
Command cmd = new JobCommand();
Pattern pattern = Pattern.compile("^" + Constants.prefixCommand + cmd.getName() + cmd.getPattern() + "$");
assertTrue(pattern.matcher(Constants.prefixCommand + "job job").find());
assertTrue(pattern.matcher(Constants.prefixCommand + "job job 1").find());
assertTrue(pattern.matcher(Constants.prefixCommand + "job job 78").find());
assertTrue(pattern.matcher(Constants.prefixCommand + "job job 200").find());
assertTrue(pattern.matcher(Constants.prefixCommand + "job pêcheur 200").find());
assertTrue(pattern.matcher(Constants.prefixCommand + "job forgeur d'épée 200").find());
assertTrue(pattern.matcher(Constants.prefixCommand + "job -all 200").find());
assertTrue(pattern.matcher(Constants.prefixCommand + "job").find());
}
use of commands.model.Command in project KaellyBot by Kaysoro.
the class CommandPatternTest method testAdminCommand.
// ADMIN COMMANDS
public void testAdminCommand() {
Command cmd = new AdminCommand();
Pattern pattern = Pattern.compile("^" + Constants.prefixCommand + cmd.getName() + cmd.getPattern() + "$");
assertTrue(pattern.matcher(Constants.prefixCommand + "admin").find());
assertTrue(pattern.matcher(Constants.prefixCommand + "admin help").find());
assertTrue(pattern.matcher(Constants.prefixCommand + "admin hélp").find());
assertTrue(pattern.matcher(Constants.prefixCommand + "admin !help").find());
assertTrue(pattern.matcher(Constants.prefixCommand + "admin !help2").find());
}
Aggregations