use of commands.model.Command in project KaellyBot by Kaysoro.
the class CommandPatternTest method testStatCommand.
public void testStatCommand() {
Command cmd = new StatCommand();
Pattern pattern = Pattern.compile("^" + Constants.prefixCommand + cmd.getName() + cmd.getPattern() + "$");
assertTrue(pattern.matcher(Constants.prefixCommand + "stats").find());
}
use of commands.model.Command in project KaellyBot by Kaysoro.
the class CommandPatternTest method testAnnounceCommand.
public void testAnnounceCommand() {
Command cmd = new AnnounceCommand();
Pattern pattern = Pattern.compile("^" + Constants.prefixCommand + cmd.getName() + cmd.getPattern() + "$");
assertTrue(pattern.matcher(Constants.prefixCommand + "announce test").find());
assertTrue(pattern.matcher(Constants.prefixCommand + "announce -confirm test").find());
assertFalse(pattern.matcher(Constants.prefixCommand + "announce").find());
}
use of commands.model.Command in project KaellyBot by Kaysoro.
the class CommandPatternTest method testWhoisCommand.
public void testWhoisCommand() {
Command cmd = new WhoisCommand();
Pattern pattern = Pattern.compile("^" + Constants.prefixCommand + cmd.getName() + cmd.getPattern() + "$");
assertTrue(pattern.matcher(Constants.prefixCommand + "whois test").find());
assertTrue(pattern.matcher(Constants.prefixCommand + "whois test-test").find());
assertTrue(pattern.matcher(Constants.prefixCommand + "whois test-test server").find());
assertTrue(pattern.matcher(Constants.prefixCommand + "whois test-test EL server").find());
assertFalse(pattern.matcher(Constants.prefixCommand + "whois").find());
}
use of commands.model.Command in project KaellyBot by Kaysoro.
the class CommandPatternTest method testPrefixeCommand.
public void testPrefixeCommand() {
Command cmd = new PrefixCommand();
Pattern pattern = Pattern.compile("^" + Constants.prefixCommand + cmd.getName() + cmd.getPattern() + "$");
assertFalse(pattern.matcher(Constants.prefixCommand + "prefix").find());
assertTrue(pattern.matcher(Constants.prefixCommand + "prefix test").find());
assertTrue(pattern.matcher(Constants.prefixCommand + "prefix !&").find());
}
use of commands.model.Command in project KaellyBot by Kaysoro.
the class CommandPatternTest method testAvailableCommand.
public void testAvailableCommand() {
Command cmd = new AvailableCommand();
Pattern pattern = Pattern.compile("^" + Constants.prefixCommand + cmd.getName() + cmd.getPattern() + "$");
assertTrue(pattern.matcher(Constants.prefixCommand + "available CommandForbidden true").find());
assertTrue(pattern.matcher(Constants.prefixCommand + "available CommandForbidden on").find());
assertTrue(pattern.matcher(Constants.prefixCommand + "available CommandForbidden 0").find());
assertTrue(pattern.matcher(Constants.prefixCommand + "available CommandForbidden false").find());
assertTrue(pattern.matcher(Constants.prefixCommand + "available CommandForbidden off").find());
assertTrue(pattern.matcher(Constants.prefixCommand + "available CommandForbidden 1").find());
assertFalse(pattern.matcher(Constants.prefixCommand + "available").find());
assertFalse(pattern.matcher(Constants.prefixCommand + "available CommandForbidden").find());
}
Aggregations