コード例 #1
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));
  }
コード例 #2
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));
  }
コード例 #3
0
 @Test(expected = RuntimeException.class)
 public void it_should_complain_when_both_arguments_and_commands_are_used() {
   schemeBuilder.addCommand(firstCmd);
   schemeBuilder.addArgument(firstArg);
   fail("should not allow use of both arguments and commands");
 }