public void testAddPerson() { setup(); assertEquals(0, myLibrary.getPeople().size()); myLibrary.addPerson(p1); myLibrary.addPerson(p2); assertEquals(2, myLibrary.getPeople().size()); assertEquals(0, myLibrary.getPeople().indexOf(p1)); assertEquals(1, myLibrary.getPeople().indexOf(p2)); myLibrary.removePerson(p1); assertEquals(1, myLibrary.getPeople().size()); assertEquals(0, myLibrary.getPeople().indexOf(p2)); myLibrary.removePerson(p2); ; assertEquals(0, myLibrary.getPeople().size()); }
private void addItems() { myLibrary.addBook(b1); myLibrary.addBook(b2); myLibrary.addPerson(p1); myLibrary.addPerson(p2); }