Пример #1
0
 public void testDeleteCategoryMovesTasksToRoot() {
   AbstractTask task = new MockTask("delete");
   TaskCategory category = new TaskCategory("cat");
   taskList.addCategory(category);
   taskList.addTask(task, category);
   assertEquals(0, taskList.getDefaultCategory().getChildren().size());
   taskList.deleteCategory(category);
   taskList.getUnmatchedContainer(MockRepositoryConnector.REPOSITORY_URL);
 }
Пример #2
0
  public void testMoveToRoot() {
    AbstractTask task1 = new LocalTask("t1", "t1");
    taskList.addTask(
        task1, taskList.getUnmatchedContainer(LocalRepositoryConnector.REPOSITORY_URL));
    assertEquals(1, taskList.getDefaultCategory().getChildren().size());
    assertEquals(taskList.getDefaultCategory(), TaskCategory.getParentTaskCategory(task1));

    TaskCategory cat1 = new TaskCategory("c1");
    taskList.addCategory(cat1);

    taskList.addTask(task1, cat1);
    assertEquals(0, taskList.getDefaultCategory().getChildren().size());
    assertEquals(cat1, TaskCategory.getParentTaskCategory(task1));

    taskList.addTask(
        task1, taskList.getUnmatchedContainer(LocalRepositoryConnector.REPOSITORY_URL));
    assertEquals(1, taskList.getDefaultCategory().getChildren().size());
    assertEquals(0, cat1.getChildren().size());
    assertEquals(taskList.getDefaultCategory(), TaskCategory.getParentTaskCategory(task1));
  }