コード例 #1
0
 @Test
 public void wrongArgumentType() {
   ArgsException e = new ArgsException(WRONG_ARGUMENT_TYPE, 'x');
   assertThat(e.getMessage(), is(equalTo("Argument 'x' is not of the requested type.")));
 }
コード例 #2
0
 @Test
 public void invalidFormat() {
   ArgsException e = new ArgsException(INVALID_ARGUMENT_FORMAT, 'x', "$");
   assertThat(e.getMessage(), is(equalTo("'$' is not a valid argument format.")));
 }
コード例 #3
0
 @Test
 public void unknownArgumentName() {
   ArgsException e = new ArgsException(UNKNOWN_ARGUMENT_NAME, 'x');
   assertThat(e.getMessage(), is(equalTo("Argument 'x' did not appear in schema.")));
 }
コード例 #4
0
 @Test
 public void missingDouble() {
   ArgsException e = new ArgsException(MISSING_DOUBLE, 'x');
   assertThat(e.getMessage(), is(equalTo("Could not find double parameter for -x.")));
 }
コード例 #5
0
 @Test
 public void invalidArgumentName() {
   ArgsException e = new ArgsException(INVALID_ARGUMENT_NAME, '#');
   assertThat(e.getMessage(), is(equalTo("'#' is not a valid argument name.")));
 }
コード例 #6
0
 @Test
 public void invalidDouble() {
   ArgsException e = new ArgsException(INVALID_DOUBLE, 'x', "Forty two");
   assertThat(e.getMessage(), is(equalTo("Argument -x expects a double but was 'Forty two'.")));
 }
コード例 #7
0
 @Test
 public void missingInteger() {
   ArgsException e = new ArgsException(MISSING_INTEGER, 'x');
   assertThat(e.getMessage(), is(equalTo("Could not find integer parameter for -x.")));
 }
コード例 #8
0
 @Test
 public void invalidInteger() {
   ArgsException e = new ArgsException(INVALID_INTEGER, 'x', "Forty two");
   assertThat(e.getMessage(), is(equalTo("Argument -x expects an integer but was 'Forty two'.")));
 }
コード例 #9
0
 @Test
 public void missingString() {
   ArgsException e = new ArgsException(MISSING_STRING, 'x');
   assertThat(e.getMessage(), is(equalTo("Could not find string parameter for -x.")));
 }
コード例 #10
0
 @Test
 public void unexpectedArgument() {
   ArgsException e = new ArgsException(UNEXPECTED_ARGUMENT, 'x');
   assertThat(e.getMessage(), is(equalTo("Argument -x unexpected.")));
 }