@Test public void it_should_reset_properly_after_building_scheme() { schemeBuilder.addOption(unkownOpt); schemeBuilder.buildScheme(); schemeBuilder.reset(); schemeBuilder.addOption(firstOpt); CommandScheme scheme = schemeBuilder.buildScheme(); assertThat(scheme.hasOption("unknown option"), is(false)); assertThat(scheme.hasOption("basic option"), is(true)); }
@Test public void it_should_produce_a_scheme_that_knows_only_the_added_options() { schemeBuilder.addOption(firstOpt); CommandScheme scheme = schemeBuilder.buildScheme(); assertThat(scheme.hasOption("unknown option"), is(false)); }
@Test public void it_should_build_a_scheme() { schemeBuilder.addOption(firstOpt); CommandScheme scheme = schemeBuilder.buildScheme(); assertThat(scheme.hasOption("basic option"), is(true)); }
@Test public void it_should_produce_a_scheme_without_not_provided_commands() { schemeBuilder.addCommand(firstCmd); schemeBuilder.addCommand(firstCmd); CommandScheme scheme = schemeBuilder.buildScheme(); assertThat(scheme.hasCommand("third"), is(false)); }
@Test public void it_should_produce_a_scheme_with_the_proper_commands() { schemeBuilder.addCommand(firstCmd); schemeBuilder.addCommand(secondCmd); CommandScheme scheme = schemeBuilder.buildScheme(); assertThat(scheme.hasCommand(firstCmd), is(true)); assertThat(scheme.hasCommand(secondCmd), is(true)); }
@Test public void it_should_produce_an_empty_scheme() { assertThat(schemeBuilder.buildScheme(), not(nullValue())); }