Test for invalid child nodes

This commit is contained in:
Nathan Adams
2014-09-22 15:34:15 +02:00
parent 397ab17e64
commit 0a71730bdc
2 changed files with 14 additions and 0 deletions
@@ -36,6 +36,13 @@ public class ArgumentCommandNodeTest {
assertThat(node.parse("123 123"), is(child));
}
@Test(expected = IllegalCommandArgumentException.class)
public void testParseInvalidChild() throws Exception {
node.addChild(argument("bar", integer()).build());
node.parse("123 bar");
}
@Test(expected = IllegalCommandArgumentException.class)
public void testParseNoChildren() throws Exception {
node.parse("123 123");