|
5 | 5 | import static com.cleancoder.args.ArgsException.ErrorCode.*; |
6 | 6 |
|
7 | 7 | public class ArgsExceptionTest extends TestCase { |
8 | | - public void testUnexpectedMessage() throws Exception { |
| 8 | + public void testUnexpectedMessage() { |
9 | 9 | ArgsException e = new ArgsException(UNEXPECTED_ARGUMENT, 'x', null); |
10 | 10 | assertEquals("Argument -x unexpected.", e.errorMessage()); |
11 | 11 | } |
12 | 12 |
|
13 | | - public void testMissingStringMessage() throws Exception { |
| 13 | + public void testMissingStringMessage() { |
14 | 14 | ArgsException e = new ArgsException(MISSING_STRING, 'x', null); |
15 | 15 | assertEquals("Could not find string parameter for -x.", e.errorMessage()); |
16 | 16 | } |
17 | 17 |
|
18 | | - public void testInvalidIntegerMessage() throws Exception { |
| 18 | + public void testInvalidIntegerMessage() { |
19 | 19 | ArgsException e = new ArgsException(INVALID_INTEGER, 'x', "Forty two"); |
20 | 20 | assertEquals("Argument -x expects an integer but was 'Forty two'.", e.errorMessage()); |
21 | 21 | } |
22 | 22 |
|
23 | | - public void testMissingIntegerMessage() throws Exception { |
| 23 | + public void testMissingIntegerMessage() { |
24 | 24 | ArgsException e = new ArgsException(MISSING_INTEGER, 'x', null); |
25 | 25 | assertEquals("Could not find integer parameter for -x.", e.errorMessage()); |
26 | 26 | } |
27 | 27 |
|
28 | | - public void testInvalidDoubleMessage() throws Exception { |
| 28 | + public void testInvalidDoubleMessage() { |
29 | 29 | ArgsException e = new ArgsException(INVALID_DOUBLE, 'x', "Forty two"); |
30 | 30 | assertEquals("Argument -x expects a double but was 'Forty two'.", e.errorMessage()); |
31 | 31 | } |
32 | 32 |
|
33 | | - public void testMissingDoubleMessage() throws Exception { |
| 33 | + public void testMissingDoubleMessage() { |
34 | 34 | ArgsException e = new ArgsException(MISSING_DOUBLE, 'x', null); |
35 | 35 | assertEquals("Could not find double parameter for -x.", e.errorMessage()); |
36 | 36 | } |
37 | 37 |
|
38 | | - public void testMissingMapMessage() throws Exception { |
| 38 | + public void testMissingMapMessage() { |
39 | 39 | ArgsException e = new ArgsException(MISSING_MAP, 'x', null); |
40 | 40 | assertEquals("Could not find map string for -x.", e.errorMessage()); |
41 | 41 | } |
42 | 42 |
|
43 | | - public void testMalformedMapMessage() throws Exception { |
| 43 | + public void testMalformedMapMessage() { |
44 | 44 | ArgsException e = new ArgsException(MALFORMED_MAP, 'x', null); |
45 | 45 | assertEquals("Map string for -x is not of form k1:v1,k2:v2...", e.errorMessage()); |
46 | 46 | } |
47 | 47 |
|
48 | | - public void testInvalidArgumentName() throws Exception { |
| 48 | + public void testInvalidArgumentName() { |
49 | 49 | ArgsException e = new ArgsException(INVALID_ARGUMENT_NAME, '#', null); |
50 | 50 | assertEquals("'#' is not a valid argument name.", e.errorMessage()); |
51 | 51 | } |
52 | 52 |
|
53 | | - public void testInvalidFormat() throws Exception { |
| 53 | + public void testInvalidFormat() { |
54 | 54 | ArgsException e = new ArgsException(INVALID_ARGUMENT_FORMAT, 'x', "$"); |
55 | 55 | assertEquals("'$' is not a valid argument format.", e.errorMessage()); |
56 | 56 | } |
|
0 commit comments