Commit e41f4d4d authored by Hallvard Trætteberg's avatar Hallvard Trætteberg
Browse files

Forbedret test for å øke testdekningsgrad

parent 7c758ece
......@@ -167,9 +167,10 @@ public class TodoListTest {
@Test
public void testFireTodoListChanged_addItemAndReceiveNotification() {
newList.addTodoListListener(list -> {
TodoListListener listener = list -> {
receivedNotificationCount++;
});
};
newList.addTodoListListener(listener);
assertEquals(0, receivedNotificationCount);
TodoItem item = newList.createTodoItem();
newList.addTodoItem(item);
......@@ -180,6 +181,9 @@ public class TodoListTest {
assertEquals(3, receivedNotificationCount);
item.setChecked(true);
assertEquals(4, receivedNotificationCount);
newList.removeTodoListListener(listener);
item.setChecked(false);
assertEquals(4, receivedNotificationCount);
}
@Test
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment