mirror of https://github.com/tasks/tasks
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1011 B
Java
44 lines
1011 B
Java
12 years ago
|
package com.todoroo.astrid.sync;
|
||
|
|
||
|
import com.todoroo.astrid.dao.TagDataDao;
|
||
|
import com.todoroo.astrid.dao.TaskDao;
|
||
|
import com.todoroo.astrid.data.TagData;
|
||
|
import com.todoroo.astrid.data.Task;
|
||
|
import com.todoroo.astrid.test.DatabaseTestCase;
|
||
|
|
||
10 years ago
|
import javax.inject.Inject;
|
||
|
|
||
12 years ago
|
public class NewSyncTestCase extends DatabaseTestCase {
|
||
11 years ago
|
|
||
10 years ago
|
@Inject TaskDao taskDao;
|
||
|
@Inject TagDataDao tagDataDao;
|
||
11 years ago
|
|
||
11 years ago
|
protected Task createTask(String title) {
|
||
12 years ago
|
Task task = new Task();
|
||
10 years ago
|
task.setTitle(title);
|
||
|
task.setImportance(SYNC_TASK_IMPORTANCE);
|
||
11 years ago
|
|
||
11 years ago
|
taskDao.createNew(task);
|
||
11 years ago
|
return task;
|
||
12 years ago
|
}
|
||
11 years ago
|
|
||
12 years ago
|
public static final String SYNC_TASK_TITLE = "new title";
|
||
|
public static final int SYNC_TASK_IMPORTANCE = Task.IMPORTANCE_MUST_DO;
|
||
11 years ago
|
|
||
11 years ago
|
protected Task createTask() {
|
||
|
return createTask(SYNC_TASK_TITLE);
|
||
12 years ago
|
}
|
||
11 years ago
|
|
||
11 years ago
|
protected TagData createTagData(String name) {
|
||
12 years ago
|
TagData tag = new TagData();
|
||
10 years ago
|
tag.setName(name);
|
||
11 years ago
|
|
||
12 years ago
|
tagDataDao.createNew(tag);
|
||
|
return tag;
|
||
|
}
|
||
11 years ago
|
|
||
12 years ago
|
protected TagData createTagData() {
|
||
11 years ago
|
return createTagData("new tag");
|
||
12 years ago
|
}
|
||
12 years ago
|
}
|