ese-unibe-ch/ese2011-team5 — Issue #40: Team test: New tests for removeEvent()
Author: icefractal
Created: 2011-10-27 15:03:37+00:00
State: open

With commit 8e7fbee434fa5bf2374592ef82d7d78d383c4820 the removeEvent() has been repaired.

New test proposals:

public void shouldRemoveCorrectEventByName() {
assertEquals(3, testCalendar.eventList.size());
assertTrue(testCalendar.eventList.get(1).getName().equals("TestEvent2"));
assertTrue(testCalendar.eventList.get(2).getName().equals("TestEvent3"));
testCalendar.removeEvent("TestEvent2");
assertEquals(2, testCalendar.eventList.size());
assertFalse(testCalendar.eventList.get(1).getName().equals("TestEvent2"));
assertTrue(testCalendar.eventList.get(1).getName().equals("TestEvent3"));
}

public void shouldRemoveCorrectEventById() {
assertEquals(3, testCalendar.eventList.size());
Long testEvent2Id = testCalendar.eventList.get(1).getId();
Long testEvent3Id = testCalendar.eventList.get(2).getId();
testCalendar.removeEvent(testEvent2Id);
assertEquals(2, testCalendar.eventList.size());
assertEquals(testEvent3Id, testCalendar.eventList.get(1).getId());
}