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.
47 lines
1.1 KiB
Java
47 lines
1.1 KiB
Java
package com.todoroo.astrid.sync;
|
|
|
|
import com.todoroo.andlib.service.Autowired;
|
|
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;
|
|
|
|
public class NewSyncTestCase extends DatabaseTestCase {
|
|
@Autowired protected TaskDao taskDao;
|
|
@Autowired protected TagDataDao tagDataDao;
|
|
|
|
@Override
|
|
protected void setUp() throws Exception {
|
|
super.setUp();
|
|
}
|
|
|
|
protected Task createTask(String title) {
|
|
Task task = new Task();
|
|
task.setTitle(title);
|
|
task.setImportance(SYNC_TASK_IMPORTANCE);
|
|
|
|
taskDao.createNew(task);
|
|
return task;
|
|
}
|
|
|
|
public static final String SYNC_TASK_TITLE = "new title";
|
|
public static final int SYNC_TASK_IMPORTANCE = Task.IMPORTANCE_MUST_DO;
|
|
|
|
protected Task createTask() {
|
|
return createTask(SYNC_TASK_TITLE);
|
|
}
|
|
|
|
protected TagData createTagData(String name) {
|
|
TagData tag = new TagData();
|
|
tag.setName(name);
|
|
|
|
tagDataDao.createNew(tag);
|
|
return tag;
|
|
}
|
|
|
|
protected TagData createTagData() {
|
|
return createTagData("new tag");
|
|
}
|
|
}
|