src/test/java/pityoulish/cmdline/CommandHandlerBaseTest.java
protected static void assertCommandAndArgs(TestCommand cmd,
                                             String[] args,
                                             TestCmdHandler tch)
  {
    assertEquals("wrong command", cmd, tch.receivedCommand);

    assertNotNull("missing command args", tch.receivedArgs);
    assertEquals("wrong number of command args",
                 args.length, tch.receivedArgs.length);

    for (int i=0; i<args.length; i++)
     {
       assertEquals("wrong command arg #"+i,
                    args[i], tch.receivedArgs[i]);
     }
  }
/**
   * Asserts that the expected command has been called with the expected args.
   *
   * @param cmd    the expected command
   * @param args   the expected arguments for the command
   * @param tch    the command handler that has been called
   */
Asserts that the expected command has been called with the expected args.
@param cmd    the expected command
@param args   the expected arguments for the command
@param tch    the command handler that has been called
Asserts that the expected command has been called with the expected args . @param cmd the expected command @param args the expected arguments for the command @param tch the command handler that has been called
protected static void assertCommandAndArgs(TestCommand cmd,
                                             String[] args,
                                             TestCmdHandler tch)
  {
    assertEquals("wrong command", cmd, tch.receivedCommand);
    assertNotNull("missing command args", tch.receivedArgs);
    assertEquals("wrong number of command args",
                 args.length, tch.receivedArgs.length);
    for (int i=0; i<args.length; i++)
     {
       assertEquals("wrong command arg #"+i,
                    args[i], tch.receivedArgs[i]);
     }
  }
protected static void assertCommandAndArgs ( TestCommand cmd , String [ ] args , TestCmdHandler tch ) { assertEquals ( "wrong command" , cmd , tch . receivedCommand ) ; assertNotNull ( "missing command args" , tch . receivedArgs ) ; assertEquals ( "wrong number of command args" , args . length , tch . receivedArgs . length ) ; for ( int i = 0 ; i < args . length ; i ++ ) { assertEquals ( "wrong command arg #" + i , args [ i ] , tch . receivedArgs [ i ] ) ; } }
Asserts that the expected command has been called with the expected args.
Asserts that the expected command has been called with the expected args .