use of commands.model.Command in project KaellyBot by Kaysoro.
the class CommandPatternTest method testSetCommand.
public void testSetCommand() {
Command cmd = new SetCommand();
Pattern pattern = Pattern.compile("^" + Constants.prefixCommand + cmd.getName() + cmd.getPattern() + "$");
assertTrue(pattern.matcher(Constants.prefixCommand + "set test").find());
assertTrue(pattern.matcher(Constants.prefixCommand + "set tést test").find());
assertTrue(pattern.matcher(Constants.prefixCommand + "set -more tést test").find());
assertFalse(pattern.matcher(Constants.prefixCommand + "set").find());
}
use of commands.model.Command in project KaellyBot by Kaysoro.
the class CommandPatternTest method testDistCommand.
public void testDistCommand() {
Command cmd = new DistanceCommand();
Pattern pattern = Pattern.compile("^" + Constants.prefixCommand + cmd.getName() + cmd.getPattern() + "$");
assertTrue(pattern.matcher(Constants.prefixCommand + "dist [20,20]").find());
assertTrue(pattern.matcher(Constants.prefixCommand + "dist [20 20]").find());
assertTrue(pattern.matcher(Constants.prefixCommand + "dist [2, -20]").find());
assertTrue(pattern.matcher(Constants.prefixCommand + "dist -20 20").find());
assertFalse(pattern.matcher(Constants.prefixCommand + "dist").find());
}
use of commands.model.Command in project KaellyBot by Kaysoro.
the class CommandPatternTest method testRSSCommand.
public void testRSSCommand() {
Command cmd = new RSSCommand();
Pattern pattern = Pattern.compile("^" + Constants.prefixCommand + cmd.getName() + cmd.getPattern() + "$");
assertTrue(pattern.matcher(Constants.prefixCommand + "rss true").find());
assertTrue(pattern.matcher(Constants.prefixCommand + "rss on").find());
assertTrue(pattern.matcher(Constants.prefixCommand + "rss 0").find());
assertTrue(pattern.matcher(Constants.prefixCommand + "rss false").find());
assertTrue(pattern.matcher(Constants.prefixCommand + "rss off").find());
assertTrue(pattern.matcher(Constants.prefixCommand + "rss 1").find());
assertFalse(pattern.matcher(Constants.prefixCommand + "rss").find());
}
use of commands.model.Command in project KaellyBot by Kaysoro.
the class CommandPatternTest method testTalkCommand.
public void testTalkCommand() {
Command cmd = new TalkCommand();
Pattern pattern = Pattern.compile("^" + Constants.prefixCommand + cmd.getName() + cmd.getPattern() + "$");
assertTrue(pattern.matcher(Constants.prefixCommand + "talk test").find());
assertTrue(pattern.matcher(Constants.prefixCommand + "talk 5681 test").find());
assertFalse(pattern.matcher(Constants.prefixCommand + "talk").find());
}
use of commands.model.Command in project KaellyBot by Kaysoro.
the class CommandPatternTest method testServerCommand.
public void testServerCommand() {
Command cmd = new ServerCommand();
Pattern pattern = Pattern.compile("^" + Constants.prefixCommand + cmd.getName() + cmd.getPattern() + "$");
assertTrue(pattern.matcher(Constants.prefixCommand + "server").find());
assertTrue(pattern.matcher(Constants.prefixCommand + "server dofus").find());
assertTrue(pattern.matcher(Constants.prefixCommand + "server -reset").find());
}
Aggregations