1   package com.lexicalscope.jewel.cli.examples;
2   
3   import static org.junit.Assert.assertEquals;
4   
5   import org.junit.Test;
6   
7   import com.lexicalscope.jewel.cli.ArgumentValidationException;
8   import com.lexicalscope.jewel.cli.CliFactory;
9   
10  public class TestListExample {
11      @Test public void testListExample() throws ArgumentValidationException {
12          final ListExample result0 =
13                  CliFactory.parseArguments(ListExample.class, new String[] { "--count", "3", "2", "1" });
14          assertEquals(3, result0.getCount().size());
15          assertEquals((Integer) 3, result0.getCount().get(0));
16          assertEquals((Integer) 2, result0.getCount().get(1));
17          assertEquals((Integer) 1, result0.getCount().get(2));
18  
19          final ListExample result1 = CliFactory.parseArguments(ListExample.class, new String[] { "--count" });
20          assertEquals(0, result1.getCount().size());
21      }
22  }