コード例 #1
0
  @Test
  public void reportsThatProbeIsSatisfiedIfSatisfied() {
    final Element element = context.mock(Element.class);

    context.checking(
        new Expectations() {
          {
            oneOf(probeCreator).createFor(element);
            will(returnValue(probe));

            oneOf(probe).doProbe();

            oneOf(probe).isSatisfied();
            will(returnValue(true));
          }
        });

    operator.doWith(element);
    assertThat(operator.isProbeSatisfied(), is(true));
  }
コード例 #2
0
  @Test
  public void reportsThatProbeIsNotSatisfiedIfNotRun() {

    assertThat(operator.isProbeSatisfied(), is(false));
  }