mirror of https://github.com/tasks/tasks
Add findExistingList tests
parent
972c1191fe
commit
27f45e64a4
@ -0,0 +1,24 @@
|
||||
package org.tasks.makers
|
||||
|
||||
import com.natpryce.makeiteasy.Instantiator
|
||||
import com.natpryce.makeiteasy.Property
|
||||
import com.natpryce.makeiteasy.PropertyLookup
|
||||
import com.natpryce.makeiteasy.PropertyValue
|
||||
import org.tasks.data.GoogleTaskList
|
||||
|
||||
object GoogleTaskListMaker {
|
||||
val REMOTE_ID: Property<GoogleTaskList, String> = Property.newProperty()
|
||||
val ACCOUNT: Property<GoogleTaskList, String?> = Property.newProperty()
|
||||
|
||||
private val instantiator = Instantiator { lookup: PropertyLookup<GoogleTaskList> ->
|
||||
val list = GoogleTaskList()
|
||||
list.remoteId = lookup.valueOf(REMOTE_ID, "1234")
|
||||
list.account = lookup.valueOf(ACCOUNT, null as String?)
|
||||
list.color = 0
|
||||
list
|
||||
}
|
||||
|
||||
fun newGoogleTaskList(vararg properties: PropertyValue<in GoogleTaskList?, *>): GoogleTaskList {
|
||||
return Maker.make(instantiator, *properties)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue