src/test/java/pityoulish/cmdline/ArgsInterpreterTest.java
protected static void assertCommandArgs(String[] args, int argc,
                                          MockCommandHandler mch)
  {
    assertNotNull("expected command handler not called", mch.receivedArgs);
    assertEquals("wrong number of command args",
                 argc, mch.receivedArgs.length);

    for (int i=0; i<argc; i++)
     {
       assertEquals("wrong command arg #"+i,
                    args[i + args.length - argc], mch.receivedArgs[i]);
     }
  }
/**
   * Asserts that the command handler has been called with the expected args.
   *
   * @param args   the arguments for the command, and possibly more
   * @param argc   the number of arguments expected by the command.
   *            This number of arguments at the end of <code>args</code>
   *            will be verified.
   * @param mch    the command handler that should have been called
   */
Asserts that the command handler has been called with the expected args.
@param args   the arguments for the command, and possibly more
@param argc   the number of arguments expected by the command.
This number of arguments at the end of args
will be verified.
@param mch    the command handler that should have been called
Asserts that the command handler has been called with the expected args . @param args the arguments for the command and possibly more @param argc the number of arguments expected by the command . This number of arguments at the end of args will be verified . @param mch the command handler that should have been called
protected static void assertCommandArgs(String[] args, int argc,
                                          MockCommandHandler mch)
  {
    assertNotNull("expected command handler not called", mch.receivedArgs);
    assertEquals("wrong number of command args",
                 argc, mch.receivedArgs.length);
    for (int i=0; i<argc; i++)
     {
       assertEquals("wrong command arg #"+i,
                    args[i + args.length - argc], mch.receivedArgs[i]);
     }
  }
protected static void assertCommandArgs ( String [ ] args , int argc , MockCommandHandler mch ) { assertNotNull ( "expected command handler not called" , mch . receivedArgs ) ; assertEquals ( "wrong number of command args" , argc , mch . receivedArgs . length ) ; for ( int i = 0 ; i < argc ; i ++ ) { assertEquals ( "wrong command arg #" + i , args [ i + args . length - argc ] , mch . receivedArgs [ i ] ) ; } }
Asserts that the command handler has been called with the expected args.
Asserts that the command handler has been called with the expected args .