コード例 #1
0
  @Test
  public void shouldNotCountDuplicatedInteractions() throws Exception {
    mockOne.simpleMethod(100);

    List<Invocation> invocations = finder.find(asList(mockOne, mockOne, mockOne));

    assertEquals(1, invocations.size());
  }
コード例 #2
0
  @Test
  public void shouldGetAllInvocationsInOrder() throws Exception {
    mockOne.simpleMethod(100);
    mockTwo.simpleMethod(200);
    mockOne.simpleMethod(300);

    List<Invocation> invocations = finder.find(asList(mockOne, mockTwo));

    assertEquals(3, invocations.size());
    assertArgumentEquals(100, invocations.get(0));
    assertArgumentEquals(200, invocations.get(1));
    assertArgumentEquals(300, invocations.get(2));
  }