@SuppressWarnings("deprecation") public void testDeleteCategoryAfterRename() { String newDesc = "newDescription"; assertNotNull(taskList); assertEquals(1, taskList.getCategories().size()); TaskCategory category = new TaskCategory("cat"); taskList.addCategory(category); assertEquals(2, taskList.getCategories().size()); taskList.renameContainer(category, newDesc); taskList.deleteCategory(category); assertEquals(1, taskList.getCategories().size()); }
@SuppressWarnings("deprecation") public void testRenameCategory() { TaskCategory category = new TaskCategory("handle", "cat"); taskList.addCategory(category); assertEquals(2, taskList.getCategories().size()); taskList.renameContainer(category, "newDescription"); AbstractTaskCategory container = taskList.getContainerForHandle("handle"); assertNotNull(container); assertEquals("newDescription", container.getSummary()); taskList.deleteCategory(container); assertEquals(1, taskList.getCategories().size()); }