Esempio n. 1
0
  @Test(dataProvider = "onCommandLongTests")
  public void executeOnCommandLongTest(
      String cmdMessage, OnCommandLong command, String[][] expectedArgs) throws Exception {
    // Build the CommandEvent
    CommandEvent event =
        new CommandEvent(
            command,
            new MessageEvent(bot, null, null, cmdMessage),
            null,
            null,
            cmdMessage,
            "?testCommand",
            hook.getArgs(cmdMessage));

    // Execute and verify values
    String returned = hook.executeOnCommandLong(event);
    assertEquals(returned, "Success", "onCommandLong doesn't return expected value");

    log.debug("Current command: " + command.getName());
    logMultiArray(expectedArgs, "Expected args");
    logMultiArray(command.getArgs(), "Given args");

    assertTrue(
        Arrays.deepEquals(command.getArgs(), expectedArgs),
        "Command test " + command.getName() + " args don't equal");
  }