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.
34 lines
914 B
Kotlin
34 lines
914 B
Kotlin
package com.todoroo.astrid.sync
|
|
|
|
import com.todoroo.astrid.dao.TaskDao
|
|
import com.todoroo.astrid.data.Task
|
|
import org.tasks.data.TagData
|
|
import org.tasks.data.TagDataDao
|
|
import org.tasks.injection.InjectingTestCase
|
|
import javax.inject.Inject
|
|
|
|
open class NewSyncTestCase : InjectingTestCase() {
|
|
@Inject lateinit var taskDao: TaskDao
|
|
@Inject lateinit var tagDataDao: TagDataDao
|
|
|
|
suspend fun createTask(): Task {
|
|
val task = Task(
|
|
title = SYNC_TASK_TITLE,
|
|
priority = SYNC_TASK_IMPORTANCE,
|
|
)
|
|
taskDao.createNew(task)
|
|
return task
|
|
}
|
|
|
|
suspend fun createTagData(): TagData {
|
|
val tag = TagData()
|
|
tag.name = "new tag"
|
|
tagDataDao.createNew(tag)
|
|
return tag
|
|
}
|
|
|
|
companion object {
|
|
private const val SYNC_TASK_TITLE = "new title"
|
|
private const val SYNC_TASK_IMPORTANCE = Task.Priority.MEDIUM
|
|
}
|
|
} |