コード例 #1
0
  @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));
  }
コード例 #2
0
  @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));
  }
コード例 #3
0
  @Test
  public void it_should_build_a_scheme() {
    schemeBuilder.addOption(firstOpt);
    CommandScheme scheme = schemeBuilder.buildScheme();

    assertThat(scheme.hasOption("basic option"), is(true));
  }
コード例 #4
0
  @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));
  }
コード例 #5
0
  @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));
  }
コード例 #6
0
 @Test
 public void it_should_produce_an_empty_scheme() {
   assertThat(schemeBuilder.buildScheme(), not(nullValue()));
 }