1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.commons.cli;
19
20 import static org.junit.jupiter.api.Assertions.assertEquals;
21 import static org.junit.jupiter.api.Assertions.assertNotNull;
22 import static org.junit.jupiter.api.Assertions.assertNull;
23
24 import org.junit.jupiter.api.Test;
25
26
27
28
29 public class AlreadySelectedExceptionTest {
30
31 @Test
32 public void testConstructor() {
33 assertEquals("a", new AlreadySelectedException("a").getMessage());
34 assertNull(new AlreadySelectedException("a").getOption());
35 final Option option = new Option("a", "d");
36 final OptionGroup group = new OptionGroup();
37 assertNotNull(new AlreadySelectedException(group, option).getMessage());
38 assertEquals(option, new AlreadySelectedException(group, option).getOption());
39 assertEquals(group, new AlreadySelectedException(group, option).getOptionGroup());
40 }
41 }