コード例 #1
0
  @Test
  public void notifiesListenersWhenAddingASniper() {
    context.checking(
        new Expectations() {
          {
            one(listener).tableChanged(with(anInsertionAtRow(0)));
          }
        });

    assertEquals(0, model.getRowCount());

    model.sniperAdded(sniper);

    assertEquals(1, model.getRowCount());
    assertRowMatchesSnapshot(0, SniperSnapshot.joining(ITEM_ID));
  }